Class: ActiveRecord::ConnectionAdapters::PostgreSQL::Column
    Do not use.  This class is for internal use only.
  
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: | |
| Instance Chain: | |
| Inherits: | ActiveRecord::ConnectionAdapters::Column 
 | 
| Defined in: | activerecord/lib/active_record/connection_adapters/postgresql/column.rb | 
Class Method Summary
::ActiveRecord::ConnectionAdapters::Column - Inherited
| .new | Instantiates a new column in the table. | 
Instance Attribute Summary
- #array (also: #array?) readonly
- 
    
      #array?  
    
    readonly
    Alias for #array. 
- #auto_incremented_by_db? ⇒ Boolean readonly
- #enum? ⇒ Boolean readonly
- #fmod readonly
- #has_default? ⇒ Boolean readonly
- #identity? ⇒ Boolean readonly
- #oid readonly
- #serial? ⇒ Boolean readonly
- #virtual? ⇒ Boolean readonly
::ActiveRecord::ConnectionAdapters::Column - Inherited
| #limit, #precision, #scale, #sql_type, #type, | |
| #auto_incremented_by_db? | whether the column is auto-populated by the database using a sequence. | 
| #auto_populated?, #bigint?, #collation, #comment, #default, #default_function, #has_default?, #name, #null, #sql_type_metadata, #virtual? | |
Instance Method Summary
- #==(other) (also: #eql?)
- #encode_with(coder)
- 
    
      #eql?(other)  
    
    Alias for #==. 
- #hash
- #init_with(coder)
- #sql_type
::ActiveRecord::ConnectionAdapters::Column - Inherited
| #==, #encode_with, | |
| #eql? | Alias for Column#==. | 
| #hash, | |
| #human_name | Returns the human name of the column name. | 
| #init_with, #deduplicated | |
::ActiveRecord::ConnectionAdapters::Deduplicable - Included
| #-@ | Alias for Deduplicable#deduplicate. | 
| #deduplicate, #deduplicated | |
Constructor Details
    .new(serial: nil, identity: nil, generated: nil)  ⇒ Column 
  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 9
def initialize(*, serial: nil, identity: nil, generated: nil, **) super @serial = serial @identity = identity @generated = generated end
Instance Attribute Details
#array (readonly) Also known as: #array?
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 37
def array .sql_type.end_with?("[]") end
#array? (readonly)
Alias for #array.
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 40
alias :array? :array
    #auto_incremented_by_db?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
    #enum?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 42
def enum? type == :enum end
#fmod (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 7
delegate :oid, :fmod, to: :
    #has_default?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 33
def has_default? super && !virtual? end
    #identity?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 16
def identity? @identity end
#oid (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 7
delegate :oid, :fmod, to: :
    #serial?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 20
def serial? @serial end
    #virtual?  ⇒ Boolean  (readonly)
  
  [ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 28
def virtual? # We assume every generated column is virtual, no matter the concrete type @generated.present? end
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]#encode_with(coder)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 57
def encode_with(coder) coder["serial"] = @serial coder["identity"] = @identity coder["generated"] = @generated super end
#eql?(other)
Alias for #==.
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 70
alias :eql? :==
#hash
[ GitHub ]#init_with(coder)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 50
def init_with(coder) @serial = coder["serial"] @identity = coder["identity"] @generated = coder["generated"] super end
#sql_type
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 46
def sql_type super.delete_suffix("[]") end