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.



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

def last_query_at
  @last_query_at
end

#shardObject



18
19
20
# File 'lib/switchman/active_record/abstract_adapter.rb', line 18

def shard
  @shard || Shard.default
end

Instance Method Details

#initialize(*args) ⇒ Object



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

def initialize(*args)
  super
  @instrumenter = Switchman::ShardedInstrumenter.new(@instrumenter, self)
  @last_query_at = Time.now
end

#quote_local_table_name(name) ⇒ Object



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

def quote_local_table_name(name)
  quote_table_name(name)
end

#schema_migrationObject



32
33
34
# File 'lib/switchman/active_record/abstract_adapter.rb', line 32

def schema_migration
  ::ActiveRecord::SchemaMigration
end