Finding entries belonging to current month (or other months)
Posted
by dchua
on Stack Overflow
See other posts from Stack Overflow
or by dchua
Published on 2010-03-15T00:39:59Z
Indexed on
2010/03/15
0:49 UTC
Read the original article
Hit count: 301
I have a model (Expense) that contains fields like 'cost'.
I'd like to iterate through all my expenses to find the sum of the cost for all entries belonging to a particular month.
Is there a way to do it in rails directly?
Expense.find(:all, :conditions => .....)
© Stack Overflow or respective owner