Commit d02bf43a authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'fix-deployment-finder-environment-in-query' into 'master'

Fix environment filter of Deployments Finder

See merge request gitlab-org/gitlab!61564
parents 6330a060 bde33eec
......@@ -33,7 +33,8 @@ class Deployment < ApplicationRecord
scope :for_environment, -> (environment) { where(environment_id: environment) }
scope :for_environment_name, -> (project, name) do
where(environment_id: Environment.select(:id).where(project: project, name: name))
where('deployments.environment_id = (?)',
Environment.select(:id).where(project: project, name: name).limit(1))
end
scope :for_status, -> (status) { where(status: status) }
......
---
title: Fix environment filter of Deployments Finder
merge_request: 61564
author:
type: performance
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