Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

eliminate single use method

  • Loading branch information...
commit 66a6a6b45a4e3cee8a33f43111abafb46969ff94 1 parent 158197b
@tenderlove tenderlove authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 activerecord/lib/active_record/relation/finder_methods.rb
View
9 activerecord/lib/active_record/relation/finder_methods.rb
@@ -243,7 +243,9 @@ def raise_record_not_found_exception!(ids, result_size, expected_size) #:nodoc:
def find_with_associations
join_dependency = construct_join_dependency
relation = except :select
- relation = construct_relation_for_association_find(join_dependency, relation)
+ relation = relation.select(join_dependency.columns)
+ relation = apply_join_dependency(relation, join_dependency)
+
if block_given?
yield relation
else
@@ -265,11 +267,6 @@ def construct_relation_for_association_calculations
apply_join_dependency(self, construct_join_dependency(arel.froms.first))
end
- def construct_relation_for_association_find(join_dependency, relation = self)
- relation = relation.select(join_dependency.columns)
- apply_join_dependency(relation, join_dependency)
- end
-
def apply_join_dependency(relation, join_dependency)
relation = relation.except(:includes, :eager_load, :preload)
relation = relation.joins join_dependency
Please sign in to comment.
Something went wrong with that request. Please try again.