Saturday, February 24, 2007

Association Options :order.

In a recent project I needed to add a method to a Ruby on Rails model that would pull out the latest entry in a related table.

has_one :order => 'key'

worked great!