blob: f60647a81e710a214ce64d9a7ee3da41439b77f1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
module ActiveRecord
module Associations
class Preloader
class SingularAssociation < Association #:nodoc:
private
def preload(preloader)
associated_records_by_owner(preloader).each do |owner, associated_records|
record = associated_records.first
association = owner.association(reflection.name)
association.target = record
association.set_inverse_instance(record) if record
end
end
end
end
end
end
|