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.2.1 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.2.0 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.8 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.7 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.6 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.5 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.4 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.3 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.2 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.1 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.1.0 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.12 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.9 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.8 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.7 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.6 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.5 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.4 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.3 db/migrate/03_create_cms_fortress_roles.rb
cms-fortress-1.0.2 db/migrate/03_create_cms_fortress_roles.rb