summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/notice_store.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/notice_store.rb b/lib/notice_store.rb
index 907c379..098c25e 100644
--- a/lib/notice_store.rb
+++ b/lib/notice_store.rb
@@ -56,15 +56,19 @@ class NoticeStore
end
end
+ def notice_affects_service(notice, service)
+ return (notice.has_key? 'affects' and not notice['affects'].nil? and notice['affects'].include? service)
+ end
+
def active_notices_for(service)
active_notices.select do |notice|
- notice.has_key? 'affects' and notice['affects'].include? service
+ notice_affects_service(notice, service)
end
end
def visible_notices_for(service)
visible_notices.select do |notice|
- notice.has_key? 'affects' and notice['affects'].include? service
+ notice_affects_service(notice, service)
end
end