Class: AuthAssist::RoleMigrations::Base

Inherits:
Object
  • Object
show all
Includes:
MigrationHelper
Defined in:
lib/generators/role_migrations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#generatorObject

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_migrationObject



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

#setupObject



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