On Mar-07-2013, at 9:08 AM, Nick Ostrovsky <[email protected]> wrote: > User.where(hash: hash) # .first
Wouldn't it be more intuitive to use the #first! method for this purpose? i.e., User.find_by_hash!(hash) is the same as User.where(hash: hash).first! I know that I often chain where conditions together (especially when using scopes), so it makes sense to raise the exception only when I actually try to fetch the record from the database. -- Tejas Dinkar http://c42.in C42 Engineering - The guys behind RubyMonk -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
