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

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -

ios - Align baselines with characters in large line heights with Text Kit -