[ci skip] The `find` method coerces the given arguments to integer if the `primary key` is integer

上级 0c5486aa
......@@ -8,7 +8,7 @@ module FinderMethods
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册