asignar la raspberry al arduino también

This commit is contained in:
f 2022-03-03 14:13:59 -03:00
parent 6930afabc8
commit cf4dfa3aad

View file

@ -12,7 +12,7 @@ class ReadingsController < ActionController::API
reading.signature = headers[:'X-Signature'] reading.signature = headers[:'X-Signature']
params[:arduinos]&.each do |a| params[:arduinos]&.each do |a|
arduino = reading.arduinos.build local_id: a[:id] arduino = reading.arduinos.build local_id: a[:id], raspberry: raspberry
a[:sensores]&.each do |s| a[:sensores]&.each do |s|
arduino.sensors.build(sensor_params s) arduino.sensors.build(sensor_params s)