Commit 0124567b authored by Vitali Tatarintev's avatar Vitali Tatarintev

Use built-in without_status scope

Use built-in into a state machine `without_status` scope
in `AlertManagement::Alert.not_resolved`
parent 92769ba5
......@@ -126,7 +126,7 @@ module AlertManagement
scope :for_environment, -> (environment) { where(environment: environment) }
scope :search, -> (query) { fuzzy_search(query, [:title, :description, :monitoring_tool, :service]) }
scope :open, -> { with_status(OPEN_STATUSES) }
scope :not_resolved, -> { where.not(status: STATUSES[:resolved]) }
scope :not_resolved, -> { without_status(:resolved) }
scope :with_prometheus_alert, -> { includes(:prometheus_alert) }
scope :order_start_time, -> (sort_order) { order(started_at: sort_order) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment