Commit a08b5144 authored by Reuben Pereira's avatar Reuben Pereira

Use map instead of collect in the ProjectParser#projects_readable_by_user function

parent 74c81cc5
...@@ -29,7 +29,7 @@ module Banzai ...@@ -29,7 +29,7 @@ module Banzai
# projects - The projects to reduce down to those readable by the user. # projects - The projects to reduce down to those readable by the user.
# user - The User for which to check the projects # user - The User for which to check the projects
def projects_readable_by_user(projects, user) 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 end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment