activerecord - Rails - find record with highest month/year -
i'm kinda stuck in select query question: have bill model, contains 2 integer attributes: month , year. retrieve more recent record (highest date) can check attribute value on it. ideas solving problem, since month , year independent attributes? thanks!
bill.order('year desc, month desc').first
Comments
Post a Comment