diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-12-12 16:35:27 +0000 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-16 01:49:30 +0530 |
commit | eba76640862d071d89c846f8624d1e651d872794 (patch) | |
tree | be04cbd5426cb1be276b1e25335f83aa77f18762 /activerecord/test/models/author.rb | |
parent | ebc47465a5865ab91dc7d058d2d8a0cc961510d7 (diff) | |
download | rails-eba76640862d071d89c846f8624d1e651d872794.tar.gz rails-eba76640862d071d89c846f8624d1e651d872794.tar.bz2 rails-eba76640862d071d89c846f8624d1e651d872794.zip |
Respect the default_scope on a join model when reading a through association
Diffstat (limited to 'activerecord/test/models/author.rb')
-rw-r--r-- | activerecord/test/models/author.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 34bfd2d881..29ee50e801 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -26,6 +26,10 @@ class Author < ActiveRecord::Base has_many :comments_with_order_and_conditions, :through => :posts, :source => :comments, :order => 'comments.body', :conditions => "comments.body like 'Thank%'" has_many :comments_with_include, :through => :posts, :source => :comments, :include => :post + has_many :first_posts + has_many :comments_on_first_posts, :through => :first_posts, :source => :comments, :order => 'posts.id desc, comments.id asc' + has_one :comment_on_first_posts, :through => :first_posts, :source => :comments, :order => 'posts.id desc, comments.id asc' + has_many :thinking_posts, :class_name => 'Post', :conditions => { :title => 'So I was thinking' }, :dependent => :delete_all has_many :welcome_posts, :class_name => 'Post', :conditions => { :title => 'Welcome to the weblog' } |