Module: ActiveRecordShards::DefaultReplicaPatches::AssociationsPreloaderAssociationLoadRecordsPatch

Defined in:
lib/active_record_shards/default_replica_patches.rb

Instance Method Summary collapse

Instance Method Details

#load_recordsObject



201
202
203
204
205
206
207
# File 'lib/active_record_shards/default_replica_patches.rb', line 201

def load_records
  if klass
    on_replica_unless_tx { super }
  else
    super
  end
end

#on_replica_unless_txObject



209
210
211
# File 'lib/active_record_shards/default_replica_patches.rb', line 209

def on_replica_unless_tx
  klass.on_replica_unless_tx { yield }
end