Class: ActiveRecord::ConnectionAdapters::Spanner::Column

Inherits:
ConnectionAdapters::Column
  • Object
show all
Defined in:
lib/active_record/connection_adapters/spanner/column.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, default, sql_type_metadata = nil, null = true, default_function = nil, collation: nil, comment: nil, primary_key: false) ⇒ Column

rubocop:disable Style/MethodDefParentheses



14
15
16
17
18
19
20
# File 'lib/active_record/connection_adapters/spanner/column.rb', line 14

def initialize(name, default,  = nil, null = true,
               default_function = nil, collation: nil, comment: nil,
               primary_key: false, **)
  # rubocop:enable Style/MethodDefParentheses
  super
  @primary_key = primary_key
end

Instance Method Details

#has_default?Boolean

rubocop:disable Naming/PredicateName

Returns:

  • (Boolean)


22
23
24
# File 'lib/active_record/connection_adapters/spanner/column.rb', line 22

def has_default? # rubocop:disable Naming/PredicateName
  super && !virtual?
end

#primary_key?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/active_record/connection_adapters/spanner/column.rb', line 30

def primary_key?
  @primary_key
end

#virtual?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/active_record/connection_adapters/spanner/column.rb', line 26

def virtual?
  .generated
end