MatthewRudy
Not a member
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 commented at 3:52 PMdef named_finder(name, *find_args) (class << self; self end).instance_eval do define_method name do self.find(*find_args) end end end ... -
MatthewRudy commented at 3:45 PMI 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 commented at 12:17 PM(notably the bumblebee doesn't know anything about args or blocks, which :try does)
-
MatthewRudy commented at 12:16 PMInteresting.
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
-
MatthewRudy commented at 10:14 AMGreat
Thanks.
I hit this problem on Monday, but didn't have time to debug it.
Nice one.