Module: ActiveRecordShards::Model::InstanceMethods
- Defined in:
- lib/active_record_shards/model.rb
Instance Method Summary collapse
Instance Method Details
#from_shard ⇒ Object
44 45 46 |
# File 'lib/active_record_shards/model.rb', line 44 def from_shard @from_shard end |
#from_slave? ⇒ Boolean
40 41 42 |
# File 'lib/active_record_shards/model.rb', line 40 def from_slave? @from_slave end |
#initialize_shard_and_slave ⇒ Object
35 36 37 38 |
# File 'lib/active_record_shards/model.rb', line 35 def initialize_shard_and_slave @from_slave = !!self.class.current_shard_selection.[:slave] @from_shard = self.class.current_shard_selection.[:shard] end |