Event#in_projects plucks IDs, which is not allowed
The scope in_projects in Event does the following:
scope :in_projects, ->(projects) do
where(project_id: projects.pluck(:id)).recent
end
Our documentation is pretty clear on the use of pluck, don't use it for cases like this. This change in turn leads to the events related queries slowing down dramatically compared to the sub-query approach.
@oswaldo @rymai It seems the two of you have been involved in this change. Please look into this because the plucking of values is not a good solution.
Edited by 🤖 GitLab Bot 🤖