scinote-web/db/migrate/20151111135802_reset_assigned_samples_counters.rb

12 lines
300 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class ResetAssignedSamplesCounters < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
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