diff --git a/.rubocop.yml b/.rubocop.yml index 47d70d453..171999072 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -517,6 +517,9 @@ Style/RedundantSelf: Style/SafeNavigation: Enabled: true +Style/SoleNestedConditional: + Enabled: true + Style/StringLiterals: EnforcedStyle: double_quotes diff --git a/app/models/comment_notifier.rb b/app/models/comment_notifier.rb index 92835e7c7..1bf3ce3c1 100644 --- a/app/models/comment_notifier.rb +++ b/app/models/comment_notifier.rb @@ -12,8 +12,8 @@ class CommentNotifier private def send_comment_email - unless @comment.commentable.is_a?(Legislation::Annotation) - Mailer.comment(@comment).deliver_later if email_on_comment? + if !@comment.commentable.is_a?(Legislation::Annotation) && email_on_comment? + Mailer.comment(@comment).deliver_later end end