Sha256: ca78b68f38bd2a98e0a38986266b1c6a57852c0d20c318aed07fe3f408e39bf9
Contents?: true
Size: 1.3 KB
Versions: 24
Compression:
Stored size: 1.3 KB
Contents
# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module SQLite3 class Column < ConnectionAdapters::Column # :nodoc: attr_reader :rowid def initialize(*, auto_increment: nil, rowid: false, generated_type: nil, **) super @auto_increment = auto_increment @rowid = rowid @generated_type = generated_type end def auto_increment? @auto_increment end def auto_incremented_by_db? auto_increment? || rowid end def virtual? !@generated_type.nil? end def virtual_stored? virtual? && @generated_type == :stored end def has_default? super && !virtual? end def init_with(coder) @auto_increment = coder["auto_increment"] super end def encode_with(coder) coder["auto_increment"] = @auto_increment super end def ==(other) other.is_a?(Column) && super && auto_increment? == other.auto_increment? end alias :eql? :== def hash Column.hash ^ super.hash ^ auto_increment?.hash ^ rowid.hash end end end end end
Version data entries
24 entries across 24 versions & 2 rubygems