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

Popular posts from this blog

linux - Could not find a package configuration file provided by "Qt5Svg" -

simple.odata.client - Simple OData Client Unlink -