Class: Hippo::Command::GenerateMigration
- Inherits:
-
NamedCommand
- Object
- Thor::Group
- NamedCommand
- Hippo::Command::GenerateMigration
- Includes:
- MigrationSupport
- Defined in:
- lib/hippo/command/generate_migration.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Attributes inherited from NamedCommand
#class_name, #client_dir, #identifier, #namespace, #spec_dir
Instance Method Summary collapse
Methods included from MigrationSupport
Methods inherited from NamedCommand
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
18 19 20 |
# File 'lib/hippo/command/generate_migration.rb', line 18 def file_name @file_name end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
18 19 20 |
# File 'lib/hippo/command/generate_migration.rb', line 18 def table_name @table_name end |
Instance Method Details
#generate_module ⇒ Object
27 28 29 |
# File 'lib/hippo/command/generate_migration.rb', line 27 def generate_module create_migration end |
#set_variables ⇒ Object
20 21 22 23 24 25 |
# File 'lib/hippo/command/generate_migration.rb', line 20 def set_variables super @file_name = name.underscore prefix = extension.db_table_prefix @table_name = prefix ? "#{prefix}_#{name.tableize}" : name.tableize end |