Class: Lotus::Commands::Generate::Migration
- Defined in:
- lib/lotus/commands/generate/migration.rb
Overview
Constant Summary collapse
- TIMESTAMP_FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'%Y%m%d%H%M%S'.freeze
- FILENAME_PATTERN =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'%{timestamp}_%{name}.rb'.freeze
Instance Attribute Summary collapse
- #name ⇒ Object readonly
- #underscored_name ⇒ Object readonly
Attributes inherited from Abstract
Instance Method Summary collapse
-
#initialize(options, name) ⇒ Migration
constructor
A new instance of Migration.
- #map_templates ⇒ Object
Methods inherited from Abstract
Methods included from Generators::Generatable
#add_mapping, #destroy, #generator, #post_process_templates, #process_templates, #start, #target_path, #template_options, #template_source_path
Constructor Details
#initialize(options, name) ⇒ Migration
Returns a new instance of Migration.
24 25 26 27 28 29 30 31 32 |
# File 'lib/lotus/commands/generate/migration.rb', line 24 def initialize(, name) super() @name = name @underscored_name = Utils::String.new(@name).underscore environment.require_application_environment assert_migration_name! end |
Instance Attribute Details
#name ⇒ Object (readonly)
8 9 10 |
# File 'lib/lotus/commands/generate/migration.rb', line 8 def name @name end |
#underscored_name ⇒ Object (readonly)
8 9 10 |
# File 'lib/lotus/commands/generate/migration.rb', line 8 def underscored_name @underscored_name end |
Instance Method Details
#map_templates ⇒ Object
34 35 36 |
# File 'lib/lotus/commands/generate/migration.rb', line 34 def map_templates add_mapping('migration.rb.tt', destination_path) end |