Skip to content

Instantly share code, notes, and snippets.

View Stanislav-Lapata's full-sized avatar

Stanislav Lapata Stanislav-Lapata

View GitHub Profile
def update_obd_device_odometer(trip)
if trip.summary.odo && trip.summary.odo > 0
vehicle = Vehicle.find_by(id: trip.vehicle.id)
if vehicle.obd_device_odometer && vehicle.obd_device_odometer < trip.summary.odo
vehicle.update_attributes(obd_device_odometer: trip.summary.odo)
end
end
end
{"images_attributes"=>[{"$error"=>"pattern", "$errorParam"=>"image/*"}, {"name"=>{}}],
"name"=>"111",
"description"=>"111",
"price"=>"1111",
"controller"=>"products",
"action"=>"create",
"product"=>{"name"=>"111", "description"=>"111", "price"=>"1111"}}