cirandas.net

ref: master

plugins/consumers_coop/db/migrate/20160528192034_add_blocks_to_consumers_coop.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
class AddBlocksToConsumersCoop < ActiveRecord::Migration
  def up
    Community.find_each(batch_size: 50) do |profile|
      profile.consumers_coop_add_own_blocks if profile.consumers_coop_settings.enabled
    end
  end
  def down
    Community.find_each(batch_size: 50) do |profile|
      profile.consumers_coop_remove_own_blocks if profile.consumers_coop_settings.enabled
    end
  end
end