Easy question: I need help writing an ActiveRecord find_all_by statement where I want to order things from newest created objects to oldest.
As a follow-up to this question: If I saved the results into a variable @records. How do I then ask for the next record in it? I want to do something like @current_record = @records.next
This code will do your initial query
And with regards to your follow up. If you want to iterate over the returned array then you can do the following
Within the iterator you could set a flag when you see a particular record then do something with the next record in the iterator.
If you wish to check whether there are any records in the array returned by the finder then you can check @records.length