diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-04 21:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-04 21:08:46 +0300 |
commit | b41cd8cb92d53454b2b160ba922d33801933a9cf (patch) | |
tree | 3519da8856f8bf12ce9e75248e5ecb9ed4eacf14 /app/models/issue | |
parent | 8d3aee3636da5181ae94d23b47c6794b5610ab01 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/issue')
-rw-r--r-- | app/models/issue/metrics.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/issue/metrics.rb b/app/models/issue/metrics.rb index 8010cbc3d78..d4e51dcfbca 100644 --- a/app/models/issue/metrics.rb +++ b/app/models/issue/metrics.rb @@ -3,6 +3,12 @@ class Issue::Metrics < ApplicationRecord belongs_to :issue + scope :for_issues, ->(issues) { where(issue: issues) } + scope :with_first_mention_not_earlier_than, -> (timestamp) { + where(first_mentioned_in_commit_at: nil) + .or(where(arel_table['first_mentioned_in_commit_at'].gteq(timestamp))) + } + def record! if issue.milestone_id.present? && self.first_associated_with_milestone_at.blank? self.first_associated_with_milestone_at = Time.now |