Skip to content

Commit

Permalink
mention that coercion only happens when the primary key is an integer…
Browse files Browse the repository at this point in the history
… and use +to_i+ formatting
  • Loading branch information
raganwald committed Apr 13, 2012
1 parent 859a91b commit dcb2279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/relation/finder_methods.rb
Expand Up @@ -6,8 +6,8 @@ module FinderMethods
# Find operates with four different retrieval approaches:
#
# * 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 no record can be found for all of the listed ids, then RecordNotFound will be raised. Find by id coerces
# its arguments to integers using #to_i.
# If no record can be found for all of the listed ids, then RecordNotFound will be raised. If the primary key
# is an integer, find by id coerces its arguments using +to_i+.
# * Find first - This will return the first record matched by the options used. These options can either be specific
# conditions or merely an order. If no record can be matched, +nil+ is returned. Use
# <tt>Model.find(:first, *args)</tt> or its shortcut <tt>Model.first(*args)</tt>.
Expand Down

0 comments on commit dcb2279

Please sign in to comment.