Class: ActiveRecord::ConnectionAdapters::PostgreSQLColumn
- Defined in:
- lib/active_record/connection_adapters/postgresql/column.rb
Overview
PostgreSQL-specific extensions to column definitions in a table.
Constant Summary
Constants inherited from Column
Column::FALSE_VALUES, Column::TRUE_VALUES
Instance Attribute Summary collapse
-
#array ⇒ Object
:nodoc:.
Attributes inherited from Column
#cast_type, #default, #default_function, #name, #null, #sql_type
Instance Method Summary collapse
-
#initialize(name, default, cast_type, sql_type = nil, null = true, default_function = nil) ⇒ PostgreSQLColumn
constructor
A new instance of PostgreSQLColumn.
Methods inherited from Column
#==, #has_default?, #hash, #human_name, #with_type
Constructor Details
#initialize(name, default, cast_type, sql_type = nil, null = true, default_function = nil) ⇒ PostgreSQLColumn
Returns a new instance of PostgreSQLColumn.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/active_record/connection_adapters/postgresql/column.rb', line 7 def initialize(name, default, cast_type, sql_type = nil, null = true, default_function = nil) if sql_type =~ /\[\]$/ @array = true super(name, default, cast_type, sql_type[0..sql_type.length - 3], null) else @array = false super(name, default, cast_type, sql_type, null) end @default_function = default_function end |
Instance Attribute Details
#array ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/active_record/connection_adapters/postgresql/column.rb', line 5 def array @array end |