From 4d3f43f3099c325d93f73354f92379ad4968c6f7 Mon Sep 17 00:00:00 2001 From: Gaurish Sharma Date: Mon, 7 Jul 2014 11:59:54 +0530 Subject: Prefer find_by over where.first for record --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') 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 Firm.create(name: "37signals"), this record will be saved in # the companies table with type = "Firm". You can then fetch this row again using - # Company.where(name: '37signals').first and it will return a Firm object. + # Company.find_by(name: '37signals') 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 -- cgit v1.2.3