On Dec 28, 2009, at 12:37 AM, ColinDKelley wrote: > > Funny you should mention that! Hobo Support has the _? operator that > does just what you want. (They mention in the documentation that they > wanted it to be called ?, but had to go with ._? to be valid Ruby.) > We use _? extensively in our application and frankly couldn't live > without it. Here's a recent thread where I contributed a simplified > implementation of that method (inspired by ActiveRecord's > AssociationProxy BTW): > > https://hobo.lighthouseapp.com/projects/8324/tickets/537-safenil-with-nil-public-methods-as-in-_to_i
Wandering ever-more-offtopic, but does anybody know exactly why Ruby 1.9 whines when removing object_id? It warns that doing so "may cause serious problem", but I've never seen a discussion of exactly *what* problem. I noted (on the above ticket) that AssociationProxy and Scope carefully avoid undefining object_id, but is that solely because of the warning? --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
