Sha256: b24b9bd5d996123ab925f879139f300d7a078496df912052ce8e95d8159a4a19

Contents?: true

Size: 277 Bytes

Versions: 11

Compression:

Stored size: 277 Bytes

Contents

class AddRoleStringStrategy < ActiveRecord::Migration
  def self.up           
    change_table :<%= table_name %> do |t|
      t.string :role, :default => 'guest'
    end
  end

  def self.down
    change_table :<%= table_name %> do |t|
      t.remove :role
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
roles_active_record-0.3.4 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.3.3 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.3.2 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.3.1 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.2.5 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.2.4 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.2.3 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.2.2 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.2.1 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.2.0 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb
roles_active_record-0.1.0 lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb