module Tako::ActiveRecordExt::Base::ClassMethods

Public Instance Methods

force_shard(shard_name) click to toggle source
# File lib/tako/active_record_ext/base.rb, line 18
def force_shard(shard_name)
  @force_shard = shard_name
end
force_shard?() click to toggle source
# File lib/tako/active_record_ext/base.rb, line 22
def force_shard?
  @force_shard.present?
end
shard(shard_name) { || ... } click to toggle source
# File lib/tako/active_record_ext/base.rb, line 5
def shard(shard_name)
  if block_given?
    Tako.shard(shard_name) do
      yield
    end
  else
    Tako::QueryChain.new(
      Tako::Repository.create_proxy(shard_name),
      self
    )
  end
end