summaryrefslogtreecommitdiffstats
path: root/db/migrate/20090503121505_populate_member_roles.rb
blob: 75ba261d405c3ab8d57f212a1374632fa2efcb4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
class PopulateMemberRoles < ActiveRecord::Migration[4.2]
  def self.up
    MemberRole.delete_all
    Member.all.each do |member|
      MemberRole.insert!({:member_id => member.id, :role_id => member.role_id})
    end
  end

  def self.down
    MemberRole.delete_all
  end
end