Commit 4b6701057526db5d5bac974b7b0f9061d493ac20
1 parent
8cc1085f
Exists in
master
and in
1 other branch
Rubocop: fix use of "if !"
Showing
2 changed files
with
1 additions
and
7 deletions
Show diff stats
.rubocop_todo.yml
@@ -335,12 +335,6 @@ Style/MultilineBlockLayout: | @@ -335,12 +335,6 @@ Style/MultilineBlockLayout: | ||
335 | Style/MultilineOperationIndentation: | 335 | Style/MultilineOperationIndentation: |
336 | Enabled: false | 336 | Enabled: false |
337 | 337 | ||
338 | -# Offense count: 1 | ||
339 | -# Cop supports --auto-correct. | ||
340 | -Style/NegatedIf: | ||
341 | - Exclude: | ||
342 | - - 'app/controllers/apps_controller.rb' | ||
343 | - | ||
344 | # Offense count: 2 | 338 | # Offense count: 2 |
345 | # Cop supports --auto-correct. | 339 | # Cop supports --auto-correct. |
346 | Style/ParallelAssignment: | 340 | Style/ParallelAssignment: |
app/controllers/apps_controller.rb
@@ -97,7 +97,7 @@ class AppsController < ApplicationController | @@ -97,7 +97,7 @@ class AppsController < ApplicationController | ||
97 | if params[:app][:notification_service_attributes] && (notification_type = params[:app][:notification_service_attributes][:type]) | 97 | if params[:app][:notification_service_attributes] && (notification_type = params[:app][:notification_service_attributes][:type]) |
98 | available_notification_classes = [NotificationService] + NotificationService.subclasses | 98 | available_notification_classes = [NotificationService] + NotificationService.subclasses |
99 | notification_class = available_notification_classes.detect{|c| c.name == notification_type} | 99 | notification_class = available_notification_classes.detect{|c| c.name == notification_type} |
100 | - if !notification_class.nil? | 100 | + if notification_class.present? |
101 | app.notification_service = notification_class.new(params[:app][:notification_service_attributes]) | 101 | app.notification_service = notification_class.new(params[:app][:notification_service_attributes]) |
102 | end | 102 | end |
103 | end | 103 | end |