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.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index bf69b4c50f0..0a8398ff29b 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -9,6 +9,7 @@ class Environment < ActiveRecord::Base
has_many :deployments, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_one :last_deployment, -> { order('deployments.id DESC') }, class_name: 'Deployment'
+ has_one :first_deployment, -> { order('deployments.id ASC') }, class_name: 'Deployment'
before_validation :nullify_external_url
before_validation :generate_slug, if: ->(env) { env.slug.blank? }