Class: ActiveRecord::Generators::ModelGenerator
- Inherits:
-
Base
- Object
- Base
- ActiveRecord::Generators::ModelGenerator
- Includes:
- Ixtlan::Generators::Singleton
- Defined in:
- lib/generators/rails/active_record/active_record_generator.rb
Instance Method Summary collapse
Methods included from Ixtlan::Generators::Singleton
Instance Method Details
#create_migration_file ⇒ Object
20 21 22 23 |
# File 'lib/generators/rails/active_record/active_record_generator.rb', line 20 def create_migration_file return unless [:migration] && [:parent].nil? migration_template "migration.rb", "db/migrate/create_#{table_name}.rb" end |
#create_model_file ⇒ Object
25 26 27 |
# File 'lib/generators/rails/active_record/active_record_generator.rb', line 25 def create_model_file template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb") end |
#create_module_file ⇒ Object
29 30 31 32 |
# File 'lib/generators/rails/active_record/active_record_generator.rb', line 29 def create_module_file return if class_path.empty? template 'module.rb', File.join('app/models', "#{class_path.join('/')}.rb") if behavior == :invoke end |