Modernise use of find and update_all in database migrations
This commit is contained in:
parent
1a38e9b315
commit
360333d37d
6 changed files with 13 additions and 13 deletions
|
@ -9,7 +9,7 @@ class TileTracepoints < ActiveRecord::Migration
|
|||
if ENV["USE_DB_FUNCTIONS"]
|
||||
Tracepoint.update_all("latitude = latitude * 10, longitude = longitude * 10, tile = tile_for_point(latitude * 10, longitude * 10)")
|
||||
else
|
||||
Tracepoint.find(:all).each do |tp|
|
||||
Tracepoint.all.each do |tp|
|
||||
tp.latitude = tp.latitude * 10
|
||||
tp.longitude = tp.longitude * 10
|
||||
tp.save!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue