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.
586 587 588 589 590 |
# File 'lib/migration_defs.rb', line 586 def initialize(name) @name = name @index_name = "''" @new_index_name = "''" end |
Instance Attribute Details
#index_name ⇒ Object
Returns the value of attribute index_name.
584 585 586 |
# File 'lib/migration_defs.rb', line 584 def index_name @index_name end |
#name ⇒ Object
Returns the value of attribute name.
584 585 586 |
# File 'lib/migration_defs.rb', line 584 def name @name end |
#new_index_name ⇒ Object
Returns the value of attribute new_index_name.
584 585 586 |
# File 'lib/migration_defs.rb', line 584 def new_index_name @new_index_name end |
Instance Method Details
#get_str ⇒ Object
597 598 599 600 601 602 |
# File 'lib/migration_defs.rb', line 597 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
592 593 594 595 |
# File 'lib/migration_defs.rb', line 592 def parse_from_params(parse_params) @index_name = parse_params[:index_name] @new_index_name = parse_params[:new_index_name] end |