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