123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::SQLite3::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/sqlite3/column.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(auto_increment: nil, rowid: false, generated_type: nil) ⇒ Column

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 9

def initialize(*, auto_increment: nil, rowid: false, generated_type: nil, **)
  super
  @auto_increment = auto_increment
  @rowid = rowid
  @generated_type = generated_type
end

Instance Attribute Details

#auto_increment?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 16

def auto_increment?
  @auto_increment
end

#auto_incremented_by_db?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 20

def auto_incremented_by_db?
  auto_increment? || rowid
end

#has_default?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 32

def has_default?
  super && !virtual?
end

#rowid (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 7

attr_reader :rowid

#virtual?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 24

def virtual?
  !@generated_type.nil?
end

#virtual_stored?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 28

def virtual_stored?
  virtual? && @generated_type == :stored
end

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 46

def ==(other)
  other.is_a?(Column) &&
    super &&
    auto_increment? == other.auto_increment?
end

#encode_with(coder)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 41

def encode_with(coder)
  coder["auto_increment"] = @auto_increment
  super
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 51

alias :eql? :==

#hash

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 53

def hash
  Column.hash ^
    super.hash ^
    auto_increment?.hash ^
    rowid.hash
end

#init_with(coder)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 36

def init_with(coder)
  @auto_increment = coder["auto_increment"]
  super
end