From 4271bd03470026cb06ffb71b72c5b872633086bf Mon Sep 17 00:00:00 2001 From: f Date: Sat, 11 Jun 2022 14:32:09 -0300 Subject: [PATCH] no es necesario volver a filtrar por raspberry --- app/controllers/readings_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)