Method: ActiveRecord::ConnectionAdapters::Column#initialize
- Defined in:
- lib/active_record/connection_adapters/column.rb
#initialize(name, default, sql_type_metadata = nil, null = true, table_name = nil, default_function = nil, collation = nil, comment: nil) ⇒ Column
Instantiates a new column in the table.
name is the column’s name, such as supplier_id in supplier_id int. default is the type-casted default value, such as new in sales_stage varchar(20) default 'new'. sql_type_metadata is various information about the type of the column null determines if this column allows NULL values.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_record/connection_adapters/column.rb', line 16 def initialize(name, default, = nil, null = true, table_name = nil, default_function = nil, collation = nil, comment: nil) @name = name.freeze @table_name = table_name @sql_type_metadata = @null = null @default = default @default_function = default_function @collation = collation @comment = comment end |