diff --git a/lib/gitlab/cycle_analytics/summary/group/deploy.rb b/lib/gitlab/cycle_analytics/summary/group/deploy.rb index 1476a5fceb8..78d677cf558 100644 --- a/lib/gitlab/cycle_analytics/summary/group/deploy.rb +++ b/lib/gitlab/cycle_analytics/summary/group/deploy.rb @@ -18,9 +18,9 @@ module Gitlab private def find_deployments - deployments = Deployment.joins(:project) - .where(projects: { id: projects.ids }) - .where("deployments.created_at > ?", from) + deployments = Deployment.joins(:project).merge(Project.inside_path(group.full_path)) + deployments = deployments.where(projects: { id: options[:projects] }) if options[:projects] + deployments = deployments.where("deployments.created_at > ?", from) deployments.success.count end end