mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-28 01:36:33 +08:00
Update a problematic migration
This commit is contained in:
parent
ae9959dc3c
commit
bd414c8b4f
1 changed files with 2 additions and 3 deletions
|
@ -1,12 +1,11 @@
|
||||||
class UpdateMyModuleCoordinate < ActiveRecord::Migration
|
class UpdateMyModuleCoordinate < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
MyModule.all.each do |my_module|
|
MyModule.find_each do |my_module|
|
||||||
x = my_module.x
|
x = my_module.x
|
||||||
y = my_module.y
|
y = my_module.y
|
||||||
x *= 32
|
x *= 32
|
||||||
y *= 16
|
y *= 16
|
||||||
my_module.update(x: x)
|
my_module.update(x: x, y: y)
|
||||||
my_module.update(y: y)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue