I don’t know why I can never find this active record find-related stuff
when I google for it. It slays me over and over again and I keep having
to do ugly things to get around it.
If I have Articles and an article has_many :comments
How do I do this??? (pseudo code)
@articles = Article.find(:all, :conditions => “articles that have 3 or
more comments”)
thanks much,
jp
P.S. Do I need to just shut down my Rails activities for a few days and
learn how to write SQL and forget about having Rails do this for me?
That seems to have been a “bait and switch” on becoming a decent web 2.0
developer without ever having dealt with databases before. I did my
best to learn rails, but it seems there are unspoken pre-requisites like
this that keep biting me in the backside.
As an alternative to that, can anyone recommend some excellent sources
of info on non-trivial Rails finds that include “:include” and “:joins”
and “:select”. I can do all of the trivial stuff that shows up in all
of the easily found examples. As soon as I get out of that “obvious”
zone, I’m slayed time and time again.