Module: ActiveRecordShards::Model::InstanceMethods
- Defined in:
- lib/active_record_shards/model.rb
Instance Method Summary collapse
- #from_replica? ⇒ Boolean (also: #from_slave?)
- #from_shard ⇒ Object
- #initialize_shard_and_replica ⇒ Object (also: #initialize_shard_and_slave)
Instance Method Details
#from_replica? ⇒ Boolean Also known as: from_slave?
55 56 57 |
# File 'lib/active_record_shards/model.rb', line 55 def from_replica? @from_replica end |
#from_shard ⇒ Object
60 61 62 |
# File 'lib/active_record_shards/model.rb', line 60 def from_shard @from_shard end |
#initialize_shard_and_replica ⇒ Object Also known as: initialize_shard_and_slave
49 50 51 52 |
# File 'lib/active_record_shards/model.rb', line 49 def initialize_shard_and_replica @from_replica = !!self.class.current_shard_selection.[:replica] @from_shard = self.class.current_shard_selection.[:shard] end |