brighterplanet/earth — comment on commit 3a9fade25c590f3602690e464fa4374824f410d3
File: lib/earth/locality/country/data_miner.rb line 107
By ihough:

Got it, will do this in the future. I tried to do this initially but it didn't work:

update_all({ :rail_trip_diesel_intensity => :rail_trip_diesel_intensity / 1000.0 / diesel.density, :rail_trip_diesel_intensity_units => :litres_per_passenger_kilometre })

Maybe I should have done:

update_all({ :rail_trip_diesel_intensity => "rail_trip_diesel_intensity / 1000.0 / #{diesel.density}", :rail_trip_diesel_intensity_units => :litres_per_passenger_kilometre })

update_all({ :rail_trip_diesel_intensity => "rail_trip_diesel_intensity / 1000.0 / #{diesel.density}", :rail_trip_diesel_intensity_units => :litres_per_passenger_kilometre })

Is there a way to see how the update_all is going to get translated to sql? Doesn't seem to respond to .to_sql