Skip to content

Commit e8ace54

Browse files
committed
Rubocop fixes
1 parent b0ed2aa commit e8ace54

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

app/helpers/better_together/navigation_items_helper.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# frozen_string_literal: true
22

33
module BetterTogether
4-
module NavigationItemsHelper # rubocop:todo Style/Documentation
4+
# rubocop:todo Metrics/ModuleLength
5+
module NavigationItemsHelper # rubocop:todo Style/Documentation, Metrics/ModuleLength
56
def better_together_nav_area
6-
@better_together_nav_area ||= ::BetterTogether::NavigationArea.find_by(identifier: 'better-together')
7+
# rubocop:todo Layout/IndentationWidth
8+
@better_together_nav_area ||= ::BetterTogether::NavigationArea.find_by(identifier: 'better-together')
9+
# rubocop:enable Layout/IndentationWidth
710
end
811

912
# Retrieves navigation items for the BetterTogether header navigation.
@@ -79,7 +82,8 @@ def platform_footer_nav_area
7982
def mailer_footer_nav_items
8083
# Preload navigation items and their translations in a single query
8184
Mobility.with_locale(current_locale) do
82-
@mailer_footer_nav_items ||= platform_footer_nav_area&.top_level_nav_items_includes_children.excluding_hashed || []
85+
@mailer_footer_nav_items ||=
86+
platform_footer_nav_area&.top_level_nav_items_includes_children&.excluding_hashed || []
8387
end
8488
end
8589

@@ -113,7 +117,8 @@ def platform_header_nav_items
113117
def mailer_header_nav_items
114118
# Preload navigation items and their translations in a single query
115119
Mobility.with_locale(current_locale) do
116-
@mailer_header_nav_items ||= platform_header_nav_area.top_level_nav_items_includes_children.excluding_hashed || []
120+
@mailer_header_nav_items ||=
121+
platform_header_nav_area.top_level_nav_items_includes_children.excluding_hashed || []
117122
end
118123
end
119124

@@ -138,4 +143,5 @@ def current_locale
138143
I18n.locale
139144
end
140145
end
146+
# rubocop:enable Metrics/ModuleLength
141147
end

lib/tasks/data_migration.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace :better_together do # rubocop:todo Metrics/BlockLength
44
namespace :migrate_data do # rubocop:todo Metrics/BlockLength
55
desc 'Migrate nav item route name values from _path to _url'
66
task nav_item_route_name_to_url: :environment do
7-
nav_items = BetterTogether::NavigationItem.where("route_name ILIKE ?", '%_path')
7+
nav_items = BetterTogether::NavigationItem.where('route_name ILIKE ?', '%_path')
88

99
puts nav_items.size
1010

0 commit comments

Comments
 (0)