Skip to content

Commit dcb2279

Browse files
committed
mention that coercion only happens when the primary key is an integer and use +to_i+ formatting
1 parent 859a91b commit dcb2279

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/relation/finder_methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module FinderMethods
66
# Find operates with four different retrieval approaches:
77
#
88
# * 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]).
9-
# If no record can be found for all of the listed ids, then RecordNotFound will be raised. Find by id coerces
10-
# its arguments to integers using #to_i.
9+
# If no record can be found for all of the listed ids, then RecordNotFound will be raised. If the primary key
10+
# is an integer, find by id coerces its arguments using +to_i+.
1111
# * Find first - This will return the first record matched by the options used. These options can either be specific
1212
# conditions or merely an order. If no record can be matched, +nil+ is returned. Use
1313
# <tt>Model.find(:first, *args)</tt> or its shortcut <tt>Model.first(*args)</tt>.

0 commit comments

Comments
 (0)