Commit af36ec26bb3dcee1325f1cb95e626985a5b7aaee

Authored by damau
1 parent 5d01c088
Exists in master and in 1 other branch production

shifted function names around for clarity now notifcations has intervals

Showing 2 changed files with 7 additions and 3 deletions   Show diff stats
app/models/app.rb
... ... @@ -103,7 +103,7 @@ class App
103 103 end
104 104 alias :notify_on_errs? :notify_on_errs
105 105  
106   - def notifiable?
  106 + def emailable?
107 107 notify_on_errs? && notification_recipients.any?
108 108 end
109 109  
... ...
app/models/notice.rb
... ... @@ -99,12 +99,16 @@ class Notice
99 99 problem.notices_count
100 100 end
101 101  
102   - def notifiable?
  102 + def emailable?
103 103 app.email_at_notices.include?(similar_count)
104 104 end
105 105  
  106 + def should_email?
  107 + app.emailable? && emailable?
  108 + end
  109 +
106 110 def should_notify?
107   - app.notifiable? && notifiable?
  111 + app.notification_service.notify_at_notices.include?(0) || app.notification_service.notify_at_notices.include?(similar_count)
108 112 end
109 113  
110 114 protected
... ...