aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorChris Geihsler <chris@geihsler.net>2012-09-29 18:32:56 -0400
committerChris Geihsler <cgeihsler@thinkthroughmath.com>2013-04-03 18:41:12 -0400
commit453c7d6c47be01c9938af14962279e4cb2d6e506 (patch)
tree8acdefb677b3edab11136ca2113dea98e0d839c4 /activerecord/test/models
parent488699166c3558963fa82d4689a35f8c3fd93f47 (diff)
downloadrails-453c7d6c47be01c9938af14962279e4cb2d6e506.tar.gz
rails-453c7d6c47be01c9938af14962279e4cb2d6e506.tar.bz2
rails-453c7d6c47be01c9938af14962279e4cb2d6e506.zip
Chained scopes will be preloaded properly. Fixes #7490
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/post.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb
index 9aa02fa18f..3cfd1a0f76 100644
--- a/activerecord/test/models/post.rb
+++ b/activerecord/test/models/post.rb
@@ -76,6 +76,9 @@ class Post < ActiveRecord::Base
end
end
+ scope :with_comments, preload(:comments)
+ scope :with_tags, preload(:taggings)
+
has_many :interpolated_taggings, :class_name => 'Tagging', :as => :taggable, :conditions => proc { "1 = #{1}" }
has_many :interpolated_tags, :through => :taggings
has_many :interpolated_tags_2, :through => :interpolated_taggings, :source => :tag