Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Chris O'Sullivan's latest activity

Sunday, November 23 2008
1429 [PATCH] Add singular version of named_scope that returns first object was updated in Ruby on Rails
  • Chris O'Sullivan
    Chris O'Sullivan commented at 9:22 PM

    I think it IS in the spirit to want to return one object from a named_scope. After all, .first and .last return only one object (although I guess they're not 't...

Friday, November 21 2008
1429 [PATCH] Add singular version of named_scope that returns first object was updated in Ruby on Rails
  • Chris O'Sullivan
    Chris O'Sullivan commented at 5:25 PM

    (The second patch file for the singular_named_scope method)

  • Chris O'Sullivan
    Chris O'Sullivan created the ticket at 5:24 PM

    So, I find myself creating a bunch of named_scopes designed to return only one object, like this:

    
    class Book
      named_scope :most_recently_read, :order => "la...