Commit 4162ce60 authored by Justin Ho's avatar Justin Ho

Update controller query to avoid N+1

Also fix name of emitted event
parent 972562b4
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
methods: { methods: {
onClick(project) { onClick(project) {
this.$emit('projectSelected', project); this.$emit('project-selected', project);
this.$refs.dropdown.hide(true); this.$refs.dropdown.hide(true);
}, },
}, },
......
...@@ -10,7 +10,7 @@ class Profiles::SlacksController < Profiles::ApplicationController ...@@ -10,7 +10,7 @@ class Profiles::SlacksController < Profiles::ApplicationController
feature_category :users feature_category :users
def edit def edit
@projects = disabled_projects if current_user @projects = disabled_projects.inc_routes if current_user
end end
def slack_link def slack_link
......
...@@ -112,7 +112,7 @@ RSpec.describe EE::IntegrationsHelper do ...@@ -112,7 +112,7 @@ RSpec.describe EE::IntegrationsHelper do
let_it_be(:projects) { create_list(:project, 3) } let_it_be(:projects) { create_list(:project, 3) }
def relation def relation
Project.id_in(projects.pluck(:id)) Project.id_in(projects.pluck(:id)).inc_routes
end end
let(:request) do let(:request) do
......
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