summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-09-19 17:11:59 +0000
committerStan Hu <stanhu@gmail.com>2017-09-19 17:11:59 +0000
commite5b0f2167d341954c72ba885ab3154b158b322a5 (patch)
tree7cc7bee93e9d4af3a3d959dfec6f5545675f8378 /app
parent343301bc86e8b07ff9b6f485871aac7bb3bc6339 (diff)
parent05a8f401c20e2a0b35360544aba12905239cc369 (diff)
downloadgitlab-ce-e5b0f2167d341954c72ba885ab3154b158b322a5.tar.gz
Merge branch 'reoganize-deployment-indexes' into 'master'
Reorganize indexes for the "deployments" table Closes #36877 See merge request gitlab-org/gitlab-ce!14348
Diffstat (limited to 'app')
-rw-r--r--app/models/environment.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 44e39e21442..b6868ccbe8f 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -6,9 +6,7 @@ class Environment < ActiveRecord::Base
belongs_to :project, required: true, validate: true
- has_many :deployments,
- -> (env) { where(project_id: env.project_id) },
- dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
+ has_many :deployments, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_one :last_deployment, -> { order('deployments.id DESC') }, class_name: 'Deployment'