aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/post.rb
diff options
context:
space:
mode:
authorGrant Ammons <grant@pipelinedealsco.com>2010-06-28 16:37:38 -0400
committerJosé Valim <jose.valim@gmail.com>2010-07-08 22:36:26 +0200
commit17650e394fae26984d506fd0f705bc32e5a5de27 (patch)
tree10f2628b9b4db4a4a0df3dc8c5f061d2aac5d8e1 /activerecord/test/models/post.rb
parente848ab527ca9da1a6cf2a8485163f01daf3f66d1 (diff)
downloadrails-17650e394fae26984d506fd0f705bc32e5a5de27.tar.gz
rails-17650e394fae26984d506fd0f705bc32e5a5de27.tar.bz2
rails-17650e394fae26984d506fd0f705bc32e5a5de27.zip
Eager loading :through associations will join the :source model if there are :conditions. [#2362 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/models/post.rb')
-rw-r--r--activerecord/test/models/post.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb
index dd06822cfd..6c7b93be87 100644
--- a/activerecord/test/models/post.rb
+++ b/activerecord/test/models/post.rb
@@ -58,6 +58,7 @@ class Post < ActiveRecord::Base
end
end
+ has_many :misc_tags, :through => :taggings, :source => :tag, :conditions => "tags.name = 'Misc'"
has_many :funky_tags, :through => :taggings, :source => :tag
has_many :super_tags, :through => :taggings
has_one :tagging, :as => :taggable