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

java - inputmismatch exception -

c - zlib and gdi32 with OpenSSL? -

Formatting string according to pattern without regex in php -