Module: Switchman::ActiveRecord::CollectionAssociation
- Defined in:
- lib/switchman/active_record/association.rb
Instance Method Summary collapse
Instance Method Details
#get_records ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/switchman/active_record/association.rb', line 39 def get_records shards = reflection.[:multishard] && owner.respond_to?(:associated_shards) ? owner.associated_shards : [shard] # activate both the owner and the target's shard category, so that Reflection#join_id_for, # when called for the owner, will be returned relative to shard the query will execute on Shard.with_each_shard(shards, [klass.shard_category, owner.class.shard_category].uniq) do super end end |