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