Commit 9f4864ff authored by allison.browne's avatar allison.browne

Fix zoom usage query to use distinct issue

parent f3e260bd
......@@ -65,7 +65,7 @@ class Issue < ApplicationRecord
scope :public_only, -> { where(confidential: false) }
scope :confidential_only, -> { where(confidential: true) }
scope :with_zoom_meetings, -> { joins(:zoom_meetings) }
scope :with_zoom_meetings, -> { joins(:zoom_meetings).select(:issues).distinct }
after_commit :expire_etag_cache
after_save :ensure_metrics, unless: :imported?
......
......@@ -23,6 +23,7 @@ describe Gitlab::UsageData do
create(:issue, project: projects[0])
create(:zoom_meeting, project: projects[0], issue: projects[0].issues[0])
create(:zoom_meeting, project: projects[0], issue: projects[0].issues[1], issue_status: :removed)
create(:zoom_meeting, project: projects[0], issue: projects[0].issues[1], issue_status: :removed)
gcp_cluster = create(:cluster, :provided_by_gcp)
create(:cluster, :provided_by_user)
create(:cluster, :provided_by_user, :disabled)
......
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