From 54cced9296d3b30406431fe886433b702778faef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 11 Aug 2021 17:25:27 +0200 Subject: [PATCH] Add and apply Style/IfWithBooleanLiteralBranches This rule was added in Rubocop 1.9.0. --- .rubocop.yml | 3 +++ app/models/poll/booth_assignment.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9b5067851..45c299599 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -469,6 +469,9 @@ Style/HashSyntax: Style/IdenticalConditionalBranches: Enabled: true +Style/IfWithBooleanLiteralBranches: + Enabled: true + Style/MethodDefParentheses: Enabled: true diff --git a/app/models/poll/booth_assignment.rb b/app/models/poll/booth_assignment.rb index 5af8e804c..e525b6ed7 100644 --- a/app/models/poll/booth_assignment.rb +++ b/app/models/poll/booth_assignment.rb @@ -12,7 +12,7 @@ class Poll has_many :recounts def shifts? - shifts.empty? ? false : true + !shifts.empty? end def unable_to_destroy?