diff --git a/app/controllers/readings_controller.rb b/app/controllers/readings_controller.rb index 1640e5d..8231af7 100644 --- a/app/controllers/readings_controller.rb +++ b/app/controllers/readings_controller.rb @@ -57,6 +57,8 @@ class ReadingsController < ActionController::API def sensor_params(sensor) sensor.permit(:timestamp, :type, :value, :unit, :error).tap do |p| p[:local_type] = p.delete :type + p[:timestamp] = Time.at p[:timestamp] + rescue TypeError end end end