aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2013-01-18 11:25:00 +0000
committerJon Leighton <j@jonathanleighton.com>2013-01-18 11:25:00 +0000
commit5f759ff063b8ed054cdde0ed4f3593ef89fe59b7 (patch)
treeab3bbb209cddd74a71966cd213e59571f585e9f2 /activerecord/lib/active_record/associations
parente8d80f73996bc19b2fab46c7519c384ce96f1928 (diff)
downloadrails-5f759ff063b8ed054cdde0ed4f3593ef89fe59b7.tar.gz
rails-5f759ff063b8ed054cdde0ed4f3593ef89fe59b7.tar.bz2
rails-5f759ff063b8ed054cdde0ed4f3593ef89fe59b7.zip
CollectionProxy should be default scoped
Fixes #8795
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb1
1 files changed, 1 insertions, 0 deletions
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