Commit af36ec26bb3dcee1325f1cb95e626985a5b7aaee
1 parent
5d01c088
Exists in
master
and in
1 other branch
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
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 | ... | ... |