ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Rolling with Ruby on Rails, Part 2
Subject:   find_all and categories
Date:   2006-09-20 14:20:24
From:   Lumpio-
I'm not really familiar with Rails, but isn't doing


@recipes = Recipe.find_all


and then limiting the results with an if while looping through ALL recipes very inefficient? Wouldn't using a WHERE clause be much better?


This is why I haven't really started using data objects - it's all easy and neat when you only need "CRUD" but I've yet to see one neat way of, for example, representing complex JOINs or any kind of functions calls in SQL when using data objects.


1 to 1 of 1
1 to 1 of 1