Class: Arfy::MigrationBuilder::ColumnMigration
- Inherits:
-
GenericMigration
- Object
- GenericMigration
- Arfy::MigrationBuilder::ColumnMigration
- Defined in:
- lib/arfy/migration_builder/builders/column.rb
Direct Known Subclasses
AddColumn, AddIndex, ChangeColumn, RemoveColumn, RemoveIndex, RenameColumn
Instance Method Summary collapse
-
#initialize(table_name, column, type = nil, options = nil) ⇒ ColumnMigration
constructor
A new instance of ColumnMigration.
Methods inherited from GenericMigration
#code_for_template, #respond_to?
Constructor Details
#initialize(table_name, column, type = nil, options = nil) ⇒ ColumnMigration
Returns a new instance of ColumnMigration.
14 15 16 17 18 19 20 21 22 |
# File 'lib/arfy/migration_builder/builders/column.rb', line 14 def initialize(table_name, column, type = nil, = nil) super table_name @column = Column.new(column, type) unless .nil? .each do |name, value| @column.add_option name, value end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object (private)
25 26 27 28 29 30 |
# File 'lib/arfy/migration_builder/builders/column.rb', line 25 def method_missing(method, *args) if @column.respond_to? method return @column.send method, *args end super end |