Hi,
Hash conditions (on has_many associations) are ignored when accessing
through a HMT.
For example:
# class Author
has_many :published_posts, :class_name => "Post", :conditions =>
"posts.body = 1"
has_many :published_comments, :source => :comments, :through =>
:published_posts
Author.find(:first).published_comments # works!
But:
#class Autor
has_many :published_posts, :class_name => "Post", :conditions =>
{:published => true}
has_many :published_comments, :source => :comments, :through =>
:published_posts
Author.find(:first).published_comments # doesn''t work! :(
Here is the patch (with tests) to fix this:
http://dev.rubyonrails.org/ticket/11447
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---