Permalink
Browse files

all records have a preloaded, so eliminate that conditional

  • Loading branch information...
tenderlove committed Sep 24, 2013
1 parent 2075f39 commit 4a785415559cdb8aae00d636bd364994fec36311
Showing with 7 additions and 11 deletions.
  1. +7 −11 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

0 comments on commit 4a78541

Please sign in to comment.