Displaying 1 result from an estimated 1 matches for "find_all_before_d".
2007 May 24
4
design patterns
...r? because all
articles that I see use sql into controllers, like:
# my controller
@categories = Category.find :all, :conditions => ["date <= ? ",
Date.today] :order => "name"
Or Should I create methods on model?
#my controller
@categories = Category.find_all_before_date
@#my model (date = Date.today)
find :all, :conditions => ["date <= ? ", date] :order => "name"
2) In my app I have some reports, like that:
#report controller
sql = <<EOF
select categories.id, categories.name, sum(ledgers.value), sum(...