Class: AuthAssistant::Generators::SetupGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- AuthAssistant::Generators::SetupGenerator
- Includes:
- AuthAssist::MigrationHelper, AuthAssist::RoleMigrations
- Defined in:
- lib/generators/active_record/setup/setup_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
22 23 24 |
# File 'lib/generators/active_record/setup/setup_generator.rb', line 22 def self.source_root @source_root ||= File.("../../templates", __FILE__) end |
Instance Method Details
#run_migration ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/generators/active_record/setup/setup_generator.rb', line 26 def run_migration clear_relations :user return nil if ![:migration] clazz = AuthAssist::RoleMigrations.clazz(name) mig_obj = clazz.new(self) mig_obj.run_migration if mig_obj.respond_to? :run_migration mig_obj.configure if mig_obj.respond_to? :configure end |