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.

Ryan Bates's latest activity

Friday, December 05 2008
1115 Path to extend named routes support for an object's to_params() method was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 12:47 AM

    That is a neat idea, but I don't know if it's completely necessary. You could create a helper method to handle this:

    
    # helpers/paths_helper.rb
    def school_pat...
Friday, November 21 2008
1429 [PATCH] Add singular version of named_scope that returns first object was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 7:27 PM

    Oops, the first code snippet should be:

    
    class Book < ActiveRecord::Base
      named_scope :recently_read, :order => "last_read desc"
    end
    Book.recently_read.first...
  • Ryan Bates
    Ryan Bates commented at 7:25 PM

    Sorry, perhaps I'm missing something. Is there a reason you don't like doing this?

    
    class Book < ActiveRecord::Base
      named_scope :most_recently_read, :order ...
Friday, October 31 2008
1304 [PATCH] Readable schema.rb timestamp was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 9:39 PM

    I run into this conflict problem quite frequently too. It's really the only painful part left when working with migrations and branches.

    However, I don't think ...

Tuesday, October 28 2008
847 Pass block args for render :layout was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 8:37 PM

    Here's a patch which fixes this problem by checking for the existence of the content_for ivar before executing the block. Your tests are included.

  • Ryan Bates
    Ryan Bates commented at 6:56 PM

    This should be fixable by checking for the existence of the @content_for_* instance variable before executing the block. I'll try to write up a patch later toda...

Monday, August 25 2008
901 Fix NamedScope's delegation regex was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 3:57 PM

    +1, I also think this regular expression as a whole needs to be improved or replaced with something better. But I'm not sure what that is. Any ideas?

    One possi...

Friday, August 22 2008
884 Partial should behave the same without :collection option was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 4:05 PM

    minor changes to patch.

  • Ryan Bates
    Ryan Bates created the ticket at 4:01 PM

    There are a couple differences when rendering a partial with an array instead of passing the collection option.

    • empty array does not return nil
    • extra options ...
881 Refactoring ActionView::Partials was updated in Ruby on Rails
  • Ryan Bates
    Ryan Bates commented at 5:32 AM

    Cool, thanks for doing that.