Module: Switchman::ActiveRecord::AbstractAdapter

Defined in:
lib/switchman/active_record/abstract_adapter.rb

Defined Under Namespace

Modules: ForeignKeyCheck

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#last_query_atObject (readonly)

Returns the value of attribute last_query_at.



14
15
16
# File 'lib/switchman/active_record/abstract_adapter.rb', line 14

def last_query_at
  @last_query_at
end

#shardObject



16
17
18
# File 'lib/switchman/active_record/abstract_adapter.rb', line 16

def shard
  @shard || Shard.default
end

Instance Method Details

#initialize(*args) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/switchman/active_record/abstract_adapter.rb', line 20

def initialize(*args)
  super

  @instrumenter = Switchman::ShardedInstrumenter.new(@instrumenter, self) if ::Rails.version < "8.0"

  @last_query_at = Time.now
end

#instrumenterObject

:nodoc:



29
30
31
# File 'lib/switchman/active_record/abstract_adapter.rb', line 29

def instrumenter # :nodoc:
  @instrumenter ||= Switchman::ShardedInstrumenter.new(::ActiveSupport::Notifications.instrumenter, self)
end

#quote_local_table_name(name) ⇒ Object



34
35
36
# File 'lib/switchman/active_record/abstract_adapter.rb', line 34

def quote_local_table_name(name)
  quote_table_name(name)
end