mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-08 16:40:16 +08:00
12 lines
295 B
Ruby
12 lines
295 B
Ruby
|
class ResetAssignedSamplesCounters < ActiveRecord::Migration
|
||
|
def change
|
||
|
Sample.find_each do |sample|
|
||
|
Sample.reset_counters(sample.id, :sample_my_modules)
|
||
|
end
|
||
|
|
||
|
MyModule.find_each do |my_module|
|
||
|
MyModule.reset_counters(my_module.id, :sample_my_modules)
|
||
|
end
|
||
|
end
|
||
|
end
|