method
find_some
![Moderate documentation Importance_2](https://d2vfyqvduarcvs.cloudfront.net/images/importance_2.png?1349367920)
Register or
log in
to add new notes.
bansalakhil -
February 13, 2009
reynardmh -
November 3, 2010
metavida -
November 3, 2010
![Default_avatar_30](https://www.gravatar.com/avatar/174330d280860a6ad77a6d15dd7fabe1?default=http://apidock.com/images/default_avatar_30.png&size=30)
1 thank
throws exception
when use use Model.find([1,2,3,4])
throws exception if no record exists with any of this ID
![Default_avatar_30](https://www.gravatar.com/avatar/d591c34bd4c5749da362a2667a57dfe4?default=http://apidock.com/images/default_avatar_30.png&size=30)
1 thank
correction
I think what metavida meant was
User.find(1, 3) # ActiveRecord::RecordNotFound error
not
User.find_by_id(1, 3) # this will just return user 1
![Default_avatar_30](https://www.gravatar.com/avatar/b526ab2828ebed7151e14174a8d242d4?default=http://apidock.com/images/default_avatar_30.png&size=30)
0 thanks
RecordNotFound when any id not found
As an example of bansalakhil’s explanation.
User.find_by_id(1) #=> #<User:0x3d54a3c @attributes={"id"=>1}> User.find_by_id(2) #=> #<User:0x3d519a4 @attributes={"id"=>2}> User.find_by_id(3) #=> nil User.find_by_id(1, 2) #=> an Array with 2 User instances User.find_by_id(1, 3) #=> an ActiveRecord::RecordNotFound error