class AuthAssist::RoleMigrations::RoleAssignment

Public Instance Methods

configure() click to toggle source
# File lib/generators/role_migrations.rb, line 119
def configure
  generate_role_model
  insert_user_relation(has_roles)
end
migration_names() click to toggle source
# File lib/generators/role_migrations.rb, line 110
def migration_names
  ['add_role_id_to_user', 'create_roles']
end
reverse_configure() click to toggle source
# File lib/generators/role_migrations.rb, line 124
def reverse_configure
  remove_role_model
  remove_user_relation(has_roles)
end
reverse_migration() click to toggle source
# File lib/generators/role_migrations.rb, line 129
def reverse_migration      
  migration_template 'remove_role_assignments_migration.rb', 'remove_role_assignments'
end
run_migration() click to toggle source
# File lib/generators/role_migrations.rb, line 114
def run_migration
  migration 'add_role_id_to_user role_id:integer'
  migration 'create_roles name:string'
end