diff --git a/app/models/app.rb b/app/models/app.rb index 2f9fb2a..f86022f 100644 --- a/app/models/app.rb +++ b/app/models/app.rb @@ -103,7 +103,7 @@ class App end alias :notify_on_errs? :notify_on_errs - def notifiable? + def emailable? notify_on_errs? && notification_recipients.any? end diff --git a/app/models/notice.rb b/app/models/notice.rb index 39d3ad7..50af7f6 100644 --- a/app/models/notice.rb +++ b/app/models/notice.rb @@ -99,12 +99,16 @@ class Notice problem.notices_count end - def notifiable? + def emailable? app.email_at_notices.include?(similar_count) end + def should_email? + app.emailable? && emailable? + end + def should_notify? - app.notifiable? && notifiable? + app.notification_service.notify_at_notices.include?(0) || app.notification_service.notify_at_notices.include?(similar_count) end protected -- libgit2 0.21.2