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.