From 5f759ff063b8ed054cdde0ed4f3593ef89fe59b7 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 18 Jan 2013 11:25:00 +0000 Subject: CollectionProxy should be default scoped Fixes #8795 --- activerecord/lib/active_record/associations/collection_proxy.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 33dce58982..e93e700c93 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -33,6 +33,7 @@ module ActiveRecord def initialize(klass, association) #:nodoc: @association = association super klass, klass.arel_table + self.default_scoped = true merge! association.scope(nullify: false) end -- cgit v1.2.3