diff options
author | Xavier Noria <fxn@hashref.com> | 2016-05-10 09:15:22 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-05-10 09:15:22 +0200 |
commit | 6c471becf0c108e95e1ae5844bba6e0d481a139a (patch) | |
tree | c4ac9c0c0c8584aeaa134d08b669c84fc2105d6d /activerecord/lib/active_record/associations/association_scope.rb | |
parent | 164125c88e3a3adb363b469cd72c9d0bd22dcad8 (diff) | |
parent | 88f804d3a984e50e831ed466a3b8b2ab7df5ce85 (diff) | |
download | rails-6c471becf0c108e95e1ae5844bba6e0d481a139a.tar.gz rails-6c471becf0c108e95e1ae5844bba6e0d481a139a.tar.bz2 rails-6c471becf0c108e95e1ae5844bba6e0d481a139a.zip |
Merge pull request #24939 from Neodelf/again_with_loop
Replacement cycle for readability
Diffstat (limited to 'activerecord/lib/active_record/associations/association_scope.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_scope.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index 48437a1c9e..15844de0bc 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -124,8 +124,7 @@ module ActiveRecord scope = last_chain_scope(scope, table, owner_reflection, owner, association_klass) reflection = chain_head - loop do - break unless reflection + while reflection table = reflection.alias_name unless reflection == chain_tail |