Class: AuthAssist::RoleMigrations::Base
- Inherits:
-
Object
- Object
- AuthAssist::RoleMigrations::Base
- Includes:
- MigrationHelper
- Defined in:
- lib/generators/role_migrations.rb
Direct Known Subclasses
AdminField, MultiRoleAssignment, RoleAssignment, RoleField, RolesField, RolesMask
Instance Attribute Summary collapse
-
#generator ⇒ Object
Returns the value of attribute generator.
Instance Method Summary collapse
- #generate_reverse_migration ⇒ Object
-
#initialize(generator) ⇒ Base
constructor
A new instance of Base.
- #setup ⇒ Object
Methods included from MigrationHelper
#copy_migration, #file_reverse, #find_migration, included, #migration_dir, #migration_exists?, #reverse_migration, #reverse_migration_methods
Methods included from MigrationHelper::CodeRefactor
#clear_user_relations, #erase_in_user, #has_role_assignments, #has_roles, #has_roles_through_assignments, #role_assignment_file_content, #role_file_content, #write_model_file
Constructor Details
#initialize(generator) ⇒ Base
Returns a new instance of Base.
15 16 17 |
# File 'lib/generators/role_migrations.rb', line 15 def initialize(generator) @generator = generator end |
Instance Attribute Details
#generator ⇒ Object
Returns the value of attribute generator.
13 14 15 |
# File 'lib/generators/role_migrations.rb', line 13 def generator @generator end |
Instance Method Details
#generate_reverse_migration ⇒ Object
19 20 21 22 |
# File 'lib/generators/role_migrations.rb', line 19 def generate_reverse_migration return reverse_migration if respond_to? :reverse_migration generation.reverse_migration(migration_names.first) end |
#setup ⇒ Object
24 25 26 27 |
# File 'lib/generators/role_migrations.rb', line 24 def setup run_migration if respond_to? :run_migration configure if respond_to? :configure end |