module ActiveRecordShards::Model::InstanceMethods

Public Instance Methods

from_replica?() click to toggle source
# File lib/active_record_shards/model.rb, line 55
def from_replica?
  @from_replica
end
Also aliased as: from_slave?
from_shard() click to toggle source
# File lib/active_record_shards/model.rb, line 60
def from_shard
  @from_shard
end
from_slave?()
Alias for: from_replica?
initialize_shard_and_replica() click to toggle source
# File lib/active_record_shards/model.rb, line 49
def initialize_shard_and_replica
  @from_replica = !!self.class.current_shard_selection.options[:replica]
  @from_shard = self.class.current_shard_selection.options[:shard]
end
Also aliased as: initialize_shard_and_slave
initialize_shard_and_slave()