method
last
v2.1.0 -
Show latest stable
- Class:
ActiveRecord::Base
last(*args)public
A convenience wrapper for find(:last, *args). You can pass in all the same arguments to this method as you can to find(:last).
1Note
Calling 'last' on a has_many assoication where the order is specified as a symbol raises an error.
Calling 'last' on a has_many assoication where the order is specified as a symbol raises an error. If you use :order, the value must be a string and not a symbol. (Prior to 2.1, :order would accept a string).
There is an incomplete Lighthouse ticket for this at http://rails.lighthouseapp.com/projects/8994/tickets/341-calling-last-on-a-has_many-assoication-where-the-order-is-specified-as-a-symbol-raises-an-error#ticket-341-1