Class: MigrationDefs::RenameTableFunc
- Inherits:
-
AbstractMigrationClass
- Object
- AbstractMigrationClass
- MigrationDefs::RenameTableFunc
- Defined in:
- lib/migration_defs.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#new_name ⇒ Object
Returns the value of attribute new_name.
Instance Method Summary collapse
- #add_new_name(new_name) ⇒ Object
- #get_str ⇒ Object
-
#initialize(name) ⇒ RenameTableFunc
constructor
A new instance of RenameTableFunc.
- #parse_from_params(parse_params) ⇒ Object
Constructor Details
#initialize(name) ⇒ RenameTableFunc
Returns a new instance of RenameTableFunc.
315 316 317 |
# File 'lib/migration_defs.rb', line 315 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
313 314 315 |
# File 'lib/migration_defs.rb', line 313 def name @name end |
#new_name ⇒ Object
Returns the value of attribute new_name.
313 314 315 |
# File 'lib/migration_defs.rb', line 313 def new_name @new_name end |
Instance Method Details
#add_new_name(new_name) ⇒ Object
319 320 321 |
# File 'lib/migration_defs.rb', line 319 def add_new_name(new_name) @new_name = new_name end |
#get_str ⇒ Object
327 328 329 |
# File 'lib/migration_defs.rb', line 327 def get_str "rename_table :#{@name}" + (@new_name.blank? ? '' : ":#{@new_name}") + "\n" end |
#parse_from_params(parse_params) ⇒ Object
323 324 325 |
# File 'lib/migration_defs.rb', line 323 def parse_from_params(parse_params) @new_name = parse_params[:new_table_name] end |