scinote-web/db/migrate/20160809074757_update_my_module_coordinate.rb

13 lines
231 B
Ruby
Raw Normal View History

class UpdateMyModuleCoordinate < ActiveRecord::Migration
2016-08-10 14:36:58 +08:00
def change
MyModule.all.each do |my_module|
x = my_module.x
y = my_module.y
x *= 32
y *= 16
my_module.update(x: x)
my_module.update(y: y)
end
end
end