Use map instead of collect in the ProjectParser#projects_readable_by_user function

This commit is contained in:
Reuben Pereira 2018-07-05 21:13:46 +05:30
parent 74c81cc50e
commit a08b5144fe
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ module Banzai
# projects - The projects to reduce down to those readable by the user.
# user - The User for which to check the projects
def projects_readable_by_user(projects, user)
Project.public_or_visible_to_user(user).where("projects.id IN (?)", projects.collect(&:id)).pluck(:id)
Project.public_or_visible_to_user(user).where("projects.id IN (?)", projects.map(&:id)).pluck(:id)
end
end
end