From 453c7d6c47be01c9938af14962279e4cb2d6e506 Mon Sep 17 00:00:00 2001 From: Chris Geihsler Date: Sat, 29 Sep 2012 18:32:56 -0400 Subject: Chained scopes will be preloaded properly. Fixes #7490 --- activerecord/test/models/post.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test/models') 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 -- cgit v1.2.3