Commit 3fe954aee5ff7c86cd8768fcbebd9fbb014a9a7a

Authored by Laust Rud Jacobsen
1 parent 57d22238
Exists in master and in 1 other branch production

Rubocop: use the auto-wrapping Array() method

.rubocop_todo.yml
... ... @@ -113,13 +113,6 @@ Style/ClassAndModuleChildren:
113 113 - 'app/models/notification_services/webhook_service.rb'
114 114 - 'config/initializers/overrides.rb'
115 115  
116   -# Offense count: 1
117   -# Cop supports --auto-correct.
118   -# Configuration parameters: EnforcedStyle, SupportedStyles.
119   -Style/ClassCheck:
120   - Exclude:
121   - - 'app/helpers/navigation_helper.rb'
122   -
123 116 # Offense count: 23
124 117 Style/ConstantName:
125 118 Exclude:
... ...
app/helpers/navigation_helper.rb
... ... @@ -28,7 +28,7 @@ module NavigationHelper
28 28  
29 29 active = nil
30 30 sections.each do |controller, actions|
31   - actions = ([] << actions) unless actions.kind_of?(Array)
  31 + actions = Array(actions)
32 32 active = ' active' if current_controller == controller && (actions.include?(:all) || actions.include?(current_action))
33 33 end
34 34 active
... ...