On May 24, 2010, at 4:11 PM, Marnen Laibow-Koser wrote: > M Daubs wrote: >> Jian, >> >> This was a common practice a while ago but I would recommend against >> changing to_params. > > Why? I can't think of a good reason. > >> It will work but my experience has been that code >> gets messy as you find fringe cases. > > Huh?
The only case I come across after changing to_param is when I pass params[:id] (= "123-foo-bar") into find_by_id and forget to call to_i on it. find() by itself will do the right thing, but find_by_id won't. Not a big deal though. -philip -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.