Class: ActiveRecord::ConnectionAdapters::AlterTable
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::AlterTable
- Defined in:
- lib/active_record/connection_adapters/abstract/schema_definitions.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#adds ⇒ Object
readonly
Returns the value of attribute adds.
Instance Method Summary collapse
- #add_column(name, type, options) ⇒ Object
-
#initialize(td) ⇒ AlterTable
constructor
A new instance of AlterTable.
- #name ⇒ Object
Constructor Details
#initialize(td) ⇒ AlterTable
Returns a new instance of AlterTable.
302 303 304 305 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 302 def initialize(td) @td = td @adds = [] end |
Instance Attribute Details
#adds ⇒ Object (readonly)
Returns the value of attribute adds.
300 301 302 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 300 def adds @adds end |
Instance Method Details
#add_column(name, type, options) ⇒ Object
309 310 311 312 313 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 309 def add_column(name, type, ) name = name.to_s type = type.to_sym @adds << @td.new_column_definition(name, type, ) end |
#name ⇒ Object
307 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 307 def name; @td.name; end |