diff options
author | Gaurish Sharma <contact@gaurishsharma.com> | 2014-07-07 11:59:54 +0530 |
---|---|---|
committer | Gaurish Sharma <contact@gaurishsharma.com> | 2014-07-07 11:59:54 +0530 |
commit | 4d3f43f3099c325d93f73354f92379ad4968c6f7 (patch) | |
tree | 88c1d160acbecf9ebc9618380d12df03ec41a2a3 /activerecord | |
parent | 9d74a298f1dd72beb337001c69b63fc76ef20457 (diff) | |
download | rails-4d3f43f3099c325d93f73354f92379ad4968c6f7.tar.gz rails-4d3f43f3099c325d93f73354f92379ad4968c6f7.tar.bz2 rails-4d3f43f3099c325d93f73354f92379ad4968c6f7.zip |
Prefer find_by over where.first for record
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 662c99269e..73a9d45da1 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -230,7 +230,7 @@ module ActiveRecord #:nodoc: # # When you do <tt>Firm.create(name: "37signals")</tt>, this record will be saved in # the companies table with type = "Firm". You can then fetch this row again using - # <tt>Company.where(name: '37signals').first</tt> and it will return a Firm object. + # <tt>Company.find_by(name: '37signals')</tt> and it will return a Firm object. # # If you don't have a type column defined in your table, single-table inheritance won't # be triggered. In that case, it'll work just like normal subclasses with no special magic |