Class: ActiveRecord::ConnectionAdapters::AlterTable

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(td) ⇒ AlterTable

Returns a new instance of AlterTable


304
305
306
307
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 304

def initialize(td)
  @td   = td
  @adds = []
end

Instance Attribute Details

#addsObject (readonly)

Returns the value of attribute adds


302
303
304
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 302

def adds
  @adds
end

Instance Method Details

#add_column(name, type, options) ⇒ Object


311
312
313
314
315
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 311

def add_column(name, type, options)
  name = name.to_s
  type = type.to_sym
  @adds << @td.new_column_definition(name, type, options)
end

#nameObject


309
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 309

def name; @td.name; end