diff --git a/app/controllers/readings_controller.rb b/app/controllers/readings_controller.rb index 755d4dc..44e53b8 100644 --- a/app/controllers/readings_controller.rb +++ b/app/controllers/readings_controller.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true class ReadingsController < ActionController::API - rescue_from ActiveRecord::RecordNotFound, with: :bad_request_error - rescue_from ActionController::ParameterMissing, with: :bad_request_error +# rescue_from ActiveRecord::RecordNotFound, with: :bad_request_error +# rescue_from ActionController::ParameterMissing, with: :bad_request_error # @see {https://docutopia.tupale.co/sutty:nodemecu:api} def create @@ -21,7 +21,7 @@ class ReadingsController < ActionController::API params[:arduinos]&.reject do |a| a[:id].blank? || a[:sensores].empty? end&.each do |a| - arduino = reading.arduinos.find_or_initialize_by(local_id: a[:id], raspberry: raspberry) + arduino = reading.arduinos.find_or_initialize_by(local_id: a[:id]) a[:sensores].each do |s| arduino.sensors.build(sensor_params s)