convertir el timestamp en una fecha
This commit is contained in:
parent
535191d26d
commit
bf0e764f65
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue