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.

MatthewRudy's latest activity

Wednesday, February 25 2009
1429 [PATCH] Add singular version of named_scope that returns first object was updated in Ruby on Rails
  • MatthewRudy
    MatthewRudy commented at 3:52 PM
    
    def named_finder(name, *find_args)
      (class << self; self end).instance_eval do 
        define_method name do
          self.find(*find_args)
        end
      end
    end
    ...
  • MatthewRudy
    MatthewRudy commented at 3:45 PM

    I dont mind having some sort of declaration like this.

    But it isn't a "named_scope" by any means

    
    Book.most_recently_read.count => Exception,
    Book.most_recen...
Thursday, January 29 2009
1815 [PATCH] Add or_if_blank to Object was updated in Ruby on Rails
  • MatthewRudy
    MatthewRudy commented at 12:17 PM

    (notably the bumblebee doesn't know anything about args or blocks, which :try does)

  • MatthewRudy
    MatthewRudy commented at 12:16 PM

    Interesting.

    But I like my BumbleBee approach, which is inline with how :try is implemented

    
    person.try(:nickname) || person.full_name # if you care about a :...
Wednesday, January 21 2009
1785 Empty file uploads should not come through as empty Tempfiles was updated in Ruby on Rails
  • MatthewRudy
    MatthewRudy commented at 10:14 AM

    Great

    Thanks.

    I hit this problem on Monday, but didn't have time to debug it.

    Nice one.

Wednesday, October 01 2008
475 named_scope not functional with finder_sql was updated in Ruby on Rails
  • MatthewRudy
    MatthewRudy commented at 9:46 AM

    why am i watching this?

    crazy.

Friday, August 22 2008
859 Initializer should load files in parent directories before subdirectories to ... was updated in Ruby on Rails