Sha256: 8df5d1168b787bc27a6b2b2460362204afa9e257401eb022d9d08a391ed88357

Contents?: true

Size: 547 Bytes

Versions: 43

Compression:

Stored size: 547 Bytes

Contents

class CreateCmsFortressRoles < ActiveRecord::Migration

  def migrate(direction)
    super

    # Create default users
    {
      :administrator => {

      },
      :author => {

      },
      :contributor => {

      }
    }.each do |k, roles|
      role = Cms::Fortress::Role.create!(:name => k.to_s.humanize, :description => k.to_s.humanize)
      role.load_defaults
      role.save
    end
  end


  def change
    create_table :cms_fortress_roles do |t|
      t.string :name
      t.text :description

      t.timestamps
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
cms-fortress-1.3.15 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.14 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.13 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.12 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.11 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.10 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.9 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.8 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.7 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.6 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.5 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.4 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.3 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.2 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.1 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.0 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.0.rc3 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.0.rc2 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.3.0.rc1 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.2.2 db/migrate/03_create_cms_fortress_roles.rb