diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-31 18:08:50 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-31 18:08:50 +0300 |
commit | 68ef6ae2dacd60d20723cf453838034dcec14bf7 (patch) | |
tree | dee9a0e2addfe86f8789e9eecf79906f0e46daed /app | |
parent | 915e56340361bbdd0ed448ef935f05253ed365a9 (diff) | |
parent | db926729660d66098db717ae9f64fab0cd2f601f (diff) |
Merge branch '41587-osw-mr-metrics-migration-take-two' into 'master'
Take two for MR metrics population background migration
See merge request gitlab-org/gitlab-ce!19097
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/issuable.rb | 2 | ||||
-rw-r--r-- | app/models/issue.rb | 1 | ||||
-rw-r--r-- | app/models/merge_request.rb | 1 |
3 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index b45395343cc..44150b37708 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -97,8 +97,6 @@ module Issuable strip_attributes :title - after_save :ensure_metrics, unless: :imported? - # We want to use optimistic lock for cases when only title or description are involved # http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html def locking_enabled? diff --git a/app/models/issue.rb b/app/models/issue.rb index 559770fa442..41a290f34b4 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -62,6 +62,7 @@ class Issue < ActiveRecord::Base scope :public_only, -> { where(confidential: false) } after_save :expire_etag_cache + after_save :ensure_metrics, unless: :imported? attr_spammable :title, spam_title: true attr_spammable :description, spam_description: true diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index bc97fc3a5d9..79fc155fd3c 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -58,6 +58,7 @@ class MergeRequest < ActiveRecord::Base after_create :ensure_merge_request_diff, unless: :importing? after_update :clear_memoized_shas after_update :reload_diff_if_branch_changed + after_save :ensure_metrics # When this attribute is true some MR validation is ignored # It allows us to close or modify broken merge requests |