From db5a5eaeecaabc8959e031fcd831a584ab209041 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 8 Oct 2013 14:16:32 -0700 Subject: this method is only ever called with a reflection Stop typechecking the parameter. We know the type. --- activerecord/lib/active_record/associations/join_dependency.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 80cf933555..aa61487285 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -173,13 +173,9 @@ module ActiveRecord end end - def find_join_association(name_or_reflection, parent) - if String === name_or_reflection - name_or_reflection = name_or_reflection.to_sym - end - + def find_join_association(reflection, parent) join_associations.detect { |j| - j.reflection == name_or_reflection && j.parent == parent + j.reflection == reflection && j.parent == parent } end -- cgit v1.2.3