Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 9e663b2ee74..865f5c68af1 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, -> { Feature.enabled?(:env_last_deployment_by_finished_at, default_enabled: :yaml) ? success.ordered : success.distinct_on_environment }, class_name: 'Deployment', inverse_of: :environment
+ has_one :last_deployment, -> { success.ordered }, 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
@@ -314,13 +314,9 @@ class Environment < ApplicationRecord
def stop_actions
strong_memoize(:stop_actions) do
- if ::Feature.enabled?(:environment_multiple_stop_actions, project, default_enabled: :yaml)
- # Fix N+1 queries it brings to the serializer.
- # Tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/358780
- last_deployment_group.map(&:stop_action).compact
- else
- [last_deployment&.stop_action].compact
- end
+ # Fix N+1 queries it brings to the serializer.
+ # Tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/358780
+ last_deployment_group.map(&:stop_action).compact
end
end