diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 14:16:32 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 14:21:51 -0700 |
commit | db5a5eaeecaabc8959e031fcd831a584ab209041 (patch) | |
tree | 9b5f48b98ac510220fe50142a9920cdcc35e2efa /activerecord/lib | |
parent | 7e5c5e4d8c6c9346b8669db9faa4c3dced374646 (diff) | |
download | rails-db5a5eaeecaabc8959e031fcd831a584ab209041.tar.gz rails-db5a5eaeecaabc8959e031fcd831a584ab209041.tar.bz2 rails-db5a5eaeecaabc8959e031fcd831a584ab209041.zip |
this method is only ever called with a reflection
Stop typechecking the parameter. We know the type.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 8 |
1 files changed, 2 insertions, 6 deletions
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 |