Commit 3fe954aee5ff7c86cd8768fcbebd9fbb014a9a7a
1 parent
57d22238
Exists in
master
and in
1 other branch
Rubocop: use the auto-wrapping Array() method
Showing
2 changed files
with
1 additions
and
8 deletions
Show diff stats
.rubocop_todo.yml
@@ -113,13 +113,6 @@ Style/ClassAndModuleChildren: | @@ -113,13 +113,6 @@ Style/ClassAndModuleChildren: | ||
113 | - 'app/models/notification_services/webhook_service.rb' | 113 | - 'app/models/notification_services/webhook_service.rb' |
114 | - 'config/initializers/overrides.rb' | 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 | # Offense count: 23 | 116 | # Offense count: 23 |
124 | Style/ConstantName: | 117 | Style/ConstantName: |
125 | Exclude: | 118 | Exclude: |
app/helpers/navigation_helper.rb
@@ -28,7 +28,7 @@ module NavigationHelper | @@ -28,7 +28,7 @@ module NavigationHelper | ||
28 | 28 | ||
29 | active = nil | 29 | active = nil |
30 | sections.each do |controller, actions| | 30 | sections.each do |controller, actions| |
31 | - actions = ([] << actions) unless actions.kind_of?(Array) | 31 | + actions = Array(actions) |
32 | active = ' active' if current_controller == controller && (actions.include?(:all) || actions.include?(current_action)) | 32 | active = ' active' if current_controller == controller && (actions.include?(:all) || actions.include?(current_action)) |
33 | end | 33 | end |
34 | active | 34 | active |