diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-06 00:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-06 00:08:46 +0300 |
commit | 6cdb39a9ef2d9a3008ce2b4aeb5dacb86e0a1c2b (patch) | |
tree | 46a8685ab2511e6eaf06d2d751617b71c52e78a5 /app/models/environment.rb | |
parent | bc3187f6d968f954c7998b66a6595273f9ecf5e1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 8ec4d589c35..829c4f4159d 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -26,7 +26,7 @@ class Environment < ApplicationRecord has_many :self_managed_prometheus_alert_events, inverse_of: :environment has_many :alert_management_alerts, class_name: 'AlertManagement::Alert', inverse_of: :environment - has_one :last_deployment, -> { success.distinct_on_environment }, class_name: 'Deployment', inverse_of: :environment + has_one :last_deployment, -> { Feature.enabled?(:env_last_deployment_by_finished_at) ? success.ordered : success.distinct_on_environment }, class_name: 'Deployment', inverse_of: :environment has_one :last_visible_deployment, -> { visible.distinct_on_environment }, inverse_of: :environment, class_name: 'Deployment' has_one :last_visible_deployable, through: :last_visible_deployment, source: 'deployable', source_type: 'CommitStatus', disable_joins: true has_one :last_visible_pipeline, through: :last_visible_deployable, source: 'pipeline', disable_joins: true |