I want to return the most recent record in an array according to message_date. How would i go about this? I have this piece of code returning all and have tried using last etc. but I'm not too sure what i'm doing.
contact_messages_threads(@customer.id).each do |openmessagethread|
- @messagelast = openmessagethread.message_date
contact_messages_threads(@customer.id)oropenmessagethreadthe array you want to find the newest record in?