Is there a difference between the way collections are returned using a dynamic finder and a standard find all with a condition? I decided to convert this... @reservations = Reservation.find(:all, :conditions => ["status = ?", "Pending"]) ...to this... @reservations = Reservation.find_by_status("Pending") ...because it's much more readable and I prefer dynamic finders over conditions whenever possible. However, the collection returned by the dynamic finder apparently doesn't have the "empty?" method available to it. I use @reservations.empty? in my view to evaluate if I have an empty collection of objects and react accordingly. Is there something I'm missing? Do dynamic finders return objects in a different manner than regular finds?
on 2007-02-26 21:46
on 2007-02-26 21:53
Bah I'm an idiot. Disregard this. I forgot to use find_all_by_status instead of find_by_status.