From 4b6701057526db5d5bac974b7b0f9061d493ac20 Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Mon, 12 Oct 2015 21:57:03 +0200 Subject: [PATCH] Rubocop: fix use of "if !" --- .rubocop_todo.yml | 6 ------ app/controllers/apps_controller.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9eb7dec..b1cf35f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -335,12 +335,6 @@ Style/MultilineBlockLayout: Style/MultilineOperationIndentation: Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -Style/NegatedIf: - Exclude: - - 'app/controllers/apps_controller.rb' - # Offense count: 2 # Cop supports --auto-correct. Style/ParallelAssignment: diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index ce19b77..65da197 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -97,7 +97,7 @@ class AppsController < ApplicationController if params[:app][:notification_service_attributes] && (notification_type = params[:app][:notification_service_attributes][:type]) available_notification_classes = [NotificationService] + NotificationService.subclasses notification_class = available_notification_classes.detect{|c| c.name == notification_type} - if !notification_class.nil? + if notification_class.present? app.notification_service = notification_class.new(params[:app][:notification_service_attributes]) end end -- libgit2 0.21.2