Class: ActiveRecord::ConnectionAdapters::SQLite3::Column
- Defined in:
- activerecord/lib/active_record/connection_adapters/sqlite3/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
- #==(other) ⇒ Object (also: #eql?)
- #auto_increment? ⇒ Boolean
- #encode_with(coder) ⇒ Object
- #hash ⇒ Object
- #init_with(coder) ⇒ Object
-
#initialize(auto_increment: nil) ⇒ Column
constructor
A new instance of Column.
Methods inherited from Column
#bigint?, #has_default?, #human_name, #virtual?
Methods included from Deduplicable
Methods included from ActiveSupport::Concern
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Constructor Details
#initialize(auto_increment: nil) ⇒ Column
Returns a new instance of Column.
7 8 9 10 |
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 7 def initialize(*, auto_increment: nil, **) super @auto_increment = auto_increment end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
26 27 28 29 30 |
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 26 def ==(other) other.is_a?(Column) && super && auto_increment? == other.auto_increment? end |
#auto_increment? ⇒ Boolean
12 13 14 |
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 12 def auto_increment? @auto_increment end |
#encode_with(coder) ⇒ Object
21 22 23 24 |
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 21 def encode_with(coder) coder["auto_increment"] = @auto_increment super end |
#hash ⇒ Object
33 34 35 36 37 |
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 33 def hash Column.hash ^ super.hash ^ auto_increment?.hash end |
#init_with(coder) ⇒ Object
16 17 18 19 |
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 16 def init_with(coder) @auto_increment = coder["auto_increment"] super end |