From 3fa7dce0794b8d7bbc94845e33cf042bfc7e1a8c Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Sat, 24 Jul 2021 17:49:19 -0400 Subject: [PATCH] Remove outdated comment in ActiveRecord::Associations::AssociationScope#add_constraints [ci skip] This comment was correct when it was added in 65843e1. In that commit, ActiveRecord::AssociationScope#scope applies the nearest association's scope, and #add_constraints skips it. c8d8899 made the comment incorrect. It modified #scope not to apply the nearest association's scope and #add_constraints to apply scopes for the entire association chain. --- .../lib/active_record/associations/association_scope.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index c5e394d7af2..4898126cf48 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -123,8 +123,6 @@ module ActiveRecord chain_head = chain.first chain.reverse_each do |reflection| - # Exclude the scope of the association itself, because that - # was already merged in the #scope method. reflection.constraints.each do |scope_chain_item| item = eval_scope(reflection, scope_chain_item, owner)