From f98bb46543c6a1e180468066debca84a5f9af7ce Mon Sep 17 00:00:00 2001 From: Mehmet Emin INAC Date: Thu, 28 Feb 2019 17:12:11 +0100 Subject: [ci skip] The `find` method coerces the given arguments to integer if the `primary key` is integer --- activerecord/lib/active_record/relation/finder_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 2b5b77cd56..74f323a278 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -8,7 +8,7 @@ module ActiveRecord # Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). # If one or more records can not be found for the requested ids, then ActiveRecord::RecordNotFound will be raised. - # If the primary key is not an integer, find by id coerces its arguments using +to_i+. + # If the primary key is an integer, find by id coerces its arguments by using +to_i+. # # Person.find(1) # returns the object for ID = 1 # Person.find("1") # returns the object for ID = 1 -- cgit v1.2.3