From 48672a3f3534ca35d76af636143ee472ec5081a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 11 Aug 2021 16:34:02 +0200 Subject: [PATCH] Add and apply Style/SoleNestedConditional rule We were already applying it in most places. --- .rubocop.yml | 3 +++ app/models/comment_notifier.rb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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