Class: ActiveRecord::ConnectionAdapters::PostgreSQL::Column
- Defined in:
- lib/active_record/connection_adapters/postgresql/column.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Column
#collation, #comment, #default, #default_function, #name, #null, #sql_type_metadata
Instance Method Summary collapse
- #array ⇒ Object (also: #array?)
-
#initialize(serial: nil) ⇒ Column
constructor
A new instance of Column.
- #serial? ⇒ Boolean
- #sql_type ⇒ Object
Methods inherited from Column
#==, #bigint?, #encode_with, #has_default?, #hash, #human_name, #init_with
Constructor Details
#initialize(serial: nil) ⇒ Column
Returns a new instance of Column.
9 10 11 12 |
# File 'lib/active_record/connection_adapters/postgresql/column.rb', line 9 def initialize(*, serial: nil, **) super @serial = serial end |
Instance Method Details
#array ⇒ Object Also known as: array?
18 19 20 |
# File 'lib/active_record/connection_adapters/postgresql/column.rb', line 18 def array .sql_type.end_with?("[]") end |
#serial? ⇒ Boolean
14 15 16 |
# File 'lib/active_record/connection_adapters/postgresql/column.rb', line 14 def serial? @serial end |
#sql_type ⇒ Object
23 24 25 |
# File 'lib/active_record/connection_adapters/postgresql/column.rb', line 23 def sql_type super.sub(/\[\]\z/, "") end |