So I have an array of user ids. Is there a way in rails console to query all of these user\'s with the array
something like
ids = [1, 2, 3, 4]
users
What you're doing is supposed to work when all the ids exist.
The reason you might be seeing an exception is because at least one of those ids does not exist in the database.
Instead, you want to use find_all_by_id if you don't want to get an exception:
User.find_all_by_id([1, 2, 3, 4])
# Does the following sql:
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` IN (1, 2, 3, 4)