Class: MigrationDefs::RenameIndexFunc
- Inherits:
-
AbstractMigrationClass
- Object
- AbstractMigrationClass
- MigrationDefs::RenameIndexFunc
- Defined in:
- lib/migration_defs.rb
Instance Attribute Summary collapse
-
#index_name ⇒ Object
Returns the value of attribute index_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#new_index_name ⇒ Object
Returns the value of attribute new_index_name.
Instance Method Summary collapse
- #get_str ⇒ Object
-
#initialize(name) ⇒ RenameIndexFunc
constructor
A new instance of RenameIndexFunc.
- #parse_from_params(parse_params) ⇒ Object
Constructor Details
#initialize(name) ⇒ RenameIndexFunc
Returns a new instance of RenameIndexFunc.
587 588 589 590 591 |
# File 'lib/migration_defs.rb', line 587 def initialize(name) @name = name @index_name = "''" @new_index_name = "''" end |
Instance Attribute Details
#index_name ⇒ Object
Returns the value of attribute index_name.
585 586 587 |
# File 'lib/migration_defs.rb', line 585 def index_name @index_name end |
#name ⇒ Object
Returns the value of attribute name.
585 586 587 |
# File 'lib/migration_defs.rb', line 585 def name @name end |
#new_index_name ⇒ Object
Returns the value of attribute new_index_name.
585 586 587 |
# File 'lib/migration_defs.rb', line 585 def new_index_name @new_index_name end |
Instance Method Details
#get_str ⇒ Object
598 599 600 601 602 603 |
# File 'lib/migration_defs.rb', line 598 def get_str result = "rename_index :#{@name}" result += ", #{@index_name}" if !@index_name.nil? && !@index_name.blank? result += ", #{@new_index_name}" if !@new_index_name.nil? && !@new_index_name.blank? result += "\n" end |
#parse_from_params(parse_params) ⇒ Object
593 594 595 596 |
# File 'lib/migration_defs.rb', line 593 def parse_from_params(parse_params) @index_name = parse_params[:index_name] @new_index_name = parse_params[:new_index_name] end |