Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

all records have a preloaded, so eliminate that conditional

  • Loading branch information...
commit 4a785415559cdb8aae00d636bd364994fec36311 1 parent 2075f39
@tenderlove tenderlove authored
View
18 activerecord/lib/active_record/associations/preloader/through_association.rb
@@ -52,17 +52,13 @@ def associated_records_by_owner(preloader)
r.send(source_reflection.name)
}.compact
- if pl
- loaded_records = pl.preloaded_records
- i = 0
- record_index = loaded_records.each_with_object({}) { |r,indexes|
- indexes[r] = i
- i += 1
- }
- rhs_records.sort_by { |rhs| record_index[rhs] }
- else
- rhs_records
- end
+ loaded_records = pl.preloaded_records
+ i = 0
+ record_index = loaded_records.each_with_object({}) { |r,indexes|
+ indexes[r] = i
+ i += 1
+ }
+ rhs_records.sort_by { |rhs| record_index[rhs] }
end
}
end
Please sign in to comment.
Something went wrong with that request. Please try again.