Sha256: cd6ae47f640da1cd907eee19e1942dfee3bd8bb26e8f6221a8227dd25801173c
Contents?: true
Size: 511 Bytes
Versions: 21
Compression:
Stored size: 511 Bytes
Contents
class AddRoles < ActiveRecord::Migration def self.up create_table :roles do |t| t.string :title end create_table :roles_users, :id => false do |t| t.integer :user_id t.integer :role_id end # All users at this point will be Refinery admin users, # so we add the Refinery role to each of them. User.all.each do |user| user.roles << Role['Refinery'] user.save! end end def self.down drop_table :roles drop_table :roles_users end end
Version data entries
21 entries across 21 versions & 1 rubygems