Class: Arfy::MigrationBuilder::ColumnMigration

Inherits:
GenericMigration show all
Defined in:
lib/arfy/migration_builder/builders/column.rb

Instance Method Summary collapse

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, options = nil)
  super table_name
  @column = Column.new(column, type)
  unless options.nil?
    options.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