diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 49d3757..bb5c189 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -38,7 +38,7 @@ class ApiController < ActionController::API end def raspberry - @raspberry ||= Raspberry.find params[:controller_id] + @raspberry ||= Raspberry.find_or_create_by! params[:controller_id] end # Procesa la transacción