aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/reader.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2012-08-28 12:48:59 -0700
committerPratik Naik <pratiknaik@gmail.com>2012-08-28 12:49:55 -0700
commit754173c5ff89bf3251dfcc6577e4b3c16de8aeef (patch)
tree38441a860b917c87422077235fb150f532e74944 /activerecord/test/models/reader.rb
parent810a50dacf9ddddc1d59c1cb350e8ce785c8bf85 (diff)
downloadrails-754173c5ff89bf3251dfcc6577e4b3c16de8aeef.tar.gz
rails-754173c5ff89bf3251dfcc6577e4b3c16de8aeef.tar.bz2
rails-754173c5ff89bf3251dfcc6577e4b3c16de8aeef.zip
Add a test to make sure preloading properly merges association and default scope conditions
Diffstat (limited to 'activerecord/test/models/reader.rb')
-rw-r--r--activerecord/test/models/reader.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/models/reader.rb b/activerecord/test/models/reader.rb
index 59005ac604..f5b6079bd2 100644
--- a/activerecord/test/models/reader.rb
+++ b/activerecord/test/models/reader.rb
@@ -12,3 +12,11 @@ class SecureReader < ActiveRecord::Base
attr_accessible nil
end
+
+class LazyReader < ActiveRecord::Base
+ self.table_name = "readers"
+ default_scope -> { where(skimmer: true) }
+
+ belongs_to :post
+ belongs_to :person
+end