Class: Ditty::Generators::MigrationGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Ditty::Generators::MigrationGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/ditty/generators/migration_generator.rb
Instance Attribute Summary collapse
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
11 12 13 |
# File 'lib/ditty/generators/migration_generator.rb', line 11 def folder @folder end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
11 12 13 |
# File 'lib/ditty/generators/migration_generator.rb', line 11 def namespace @namespace end |
Class Method Details
.source_root ⇒ Object
16 17 18 |
# File 'lib/ditty/generators/migration_generator.rb', line 16 def self.source_root File.('../templates', __dir__) end |
Instance Method Details
#create_model ⇒ Object
20 21 22 23 |
# File 'lib/ditty/generators/migration_generator.rb', line 20 def create_model filename = File.join('migrations', "#{Time.now.strftime('%Y%m%d')}_#{name.underscore}.rb") template '../templates/migration.rb.erb', filename end |