diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-03 18:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-03 18:09:05 +0300 |
commit | ff8eb438401fc82b883fc4ae69626f0035b69236 (patch) | |
tree | 044a7195c0338c2b31d55dd21a5638068a5722ea /app/models/analytics | |
parent | 2ac811ce685f906d3e54e78b23f61495c19ad595 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/analytics')
-rw-r--r-- | app/models/analytics/instance_statistics/measurement.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/analytics/instance_statistics/measurement.rb b/app/models/analytics/instance_statistics/measurement.rb index a9b5393b39d..7446a28501e 100644 --- a/app/models/analytics/instance_statistics/measurement.rb +++ b/app/models/analytics/instance_statistics/measurement.rb @@ -36,6 +36,8 @@ module Analytics scope :order_by_latest, -> { order(recorded_at: :desc) } scope :with_identifier, -> (identifier) { where(identifier: identifier) } + scope :recorded_after, -> (date) { where(self.model.arel_table[:recorded_at].gteq(date)) if date.present? } + scope :recorded_before, -> (date) { where(self.model.arel_table[:recorded_at].lteq(date)) if date.present? } def self.measurement_identifier_values identifiers.values |