Module: Tako::ActiveRecordExt::ConnectionHandling

Defined in:
lib/tako/active_record_ext/connection_handling.rb

Instance Method Summary collapse

Instance Method Details

#connectionObject



4
5
6
7
8
9
10
11
# File 'lib/tako/active_record_ext/connection_handling.rb', line 4

def connection
  return Tako::Repository.create_proxy(@force_shard).connection if force_shard?
  if Tako::ProxyStack.top
    Tako::ProxyStack.top.connection
  else
    super
  end
end