Class: AuthAssist::Generators::ClearGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- AuthAssist::Generators::ClearGenerator
- Includes:
- MigrationHelper
- Defined in:
- lib/generators/auth_assist/clear/clear_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from MigrationHelper
#copy_migration, #file_reverse, #find_migration, included, #migration, #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, #insert_user_relation, #remove_user_relation, #role_assignment_file_content, #role_file_content, #write_model_file
Class Method Details
.source_root ⇒ Object
15 16 17 |
# File 'lib/generators/auth_assist/clear/clear_generator.rb', line 15 def self.source_root @source_root ||= File.("../../templates", __FILE__) end |
Instance Method Details
#generate_clear_migration ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/generators/auth_assist/clear/clear_generator.rb', line 19 def generate_clear_migration return nil if ![:migration] clazz = AuthAssist::RoleMigrations.clazz(name) obj = clazz.new(self) obj.generate_reverse_migration obj.reverse_configure if obj.respond_to? :reverse_configure end |