I think a better approach is return hash && hash[:data] && hash[:data][:details] && hash[:data][:details][:id]
That will return the value or nil if the chain was broken at any point. I know it's not the same, but much less code than the example. -------------------------------------- Sergio Campamá sergiocamp...@gmail.com On Sun, Jul 27, 2014 at 10:48 AM, Steve Klabnik <st...@steveklabnik.com> wrote: > This has a very large potential to break a very, very large amount of code. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-core+unsubscr...@googlegroups.com. > To post to this group, send email to rubyonrails-core@googlegroups.com. > Visit this group at http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.