Module: ActiveRecord::Turntable::Base

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_record/turntable/base.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#shards_transaction(options = {}, &block) ⇒ Object



122
123
124
# File 'lib/active_record/turntable/base.rb', line 122

def shards_transaction(options = {}, &block)
  self.class.shards_transaction(options, &block)
end

#turntable_shardObject



126
127
128
# File 'lib/active_record/turntable/base.rb', line 126

def turntable_shard
  turntable_cluster.select_shard(self.send(turntable_shard_key))
end