class AuthAssist::RoleMigrations::MultiRoleAssignment

Public Instance Methods

configure() click to toggle source
# File lib/generators/role_migrations.rb, line 145
def configure      
  insert_user_relation(has_role_assignments)
  insert_user_relation(has_roles_through_assignments)

  generate_role_model
  generate_role_assignment_model      
end
migration_names() click to toggle source
# File lib/generators/role_migrations.rb, line 135
def migration_names
  ['add_role_assignment_id_to_user', 'create_role_assignments', 'create_roles']
end
reverse_configure() click to toggle source
# File lib/generators/role_migrations.rb, line 153
def reverse_configure
  remove_role_model
  remove_role_assignment_model

  remove_user_relation(has_role_assignments)
  remove_user_relation(has_roles_through_assignments)
end
reverse_migration() click to toggle source
# File lib/generators/role_migrations.rb, line 161
def reverse_migration      
  migration_template 'remove_multi_role_assignments_migration.rb', 'remove_multi_role_assignments'
end
run_migration() click to toggle source
# File lib/generators/role_migrations.rb, line 139
def run_migration        
  migration 'add_role_assignment_id_to_user role_assignment_id:integer'
  migration 'create_role_assignments role_id:integer user_id:integer'      
  migration 'create_roles name:string'
end