diff options
Diffstat (limited to 'app/models/metrics/dashboard/annotation.rb')
-rw-r--r-- | app/models/metrics/dashboard/annotation.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/metrics/dashboard/annotation.rb b/app/models/metrics/dashboard/annotation.rb index 2f1b6527742..8166880f0c9 100644 --- a/app/models/metrics/dashboard/annotation.rb +++ b/app/models/metrics/dashboard/annotation.rb @@ -15,6 +15,11 @@ module Metrics validate :single_ownership validate :orphaned_annotation + scope :after, ->(after) { where('starting_at >= ?', after) } + scope :before, ->(before) { where('starting_at <= ?', before) } + + scope :for_dashboard, ->(dashboard_path) { where(dashboard_path: dashboard_path) } + private def single_ownership |