Hi,
To explain my problem, I''ll use the standard Post/author example.
Suppose I have
class Post < ActiveRecord::Base
belongs_to :author
end
I am using following to fetch the posts and author info in a single
query -
for post in Post.find(:all, :include => :author)
...
Now, I want to get *only* the posts whose author''s name starts with
"A". How do I do that?
(i.e. sort of Post.find(:all, :include => :author, :condition =>
["post.author.name like ''A%''])
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---