From f5c07155709675c3380c47c8712230b60d2b27b9 Mon Sep 17 00:00:00 2001 From: leaannbradford Date: Wed, 31 May 2023 16:04:02 -0700 Subject: [PATCH] Adds code comment and reverts a rubocop change that breaks theming --- app/controllers/concerns/hyrax/works_controller_behavior.rb | 4 +++- app/controllers/hyrax/contact_form_controller.rb | 1 + app/controllers/hyrax/homepage_controller.rb | 1 + app/controllers/hyrax/pages_controller.rb | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/hyrax/works_controller_behavior.rb b/app/controllers/concerns/hyrax/works_controller_behavior.rb index 1781b3722..f5b51f64f 100644 --- a/app/controllers/concerns/hyrax/works_controller_behavior.rb +++ b/app/controllers/concerns/hyrax/works_controller_behavior.rb @@ -508,7 +508,9 @@ def inject_show_theme_views show_theme_view_path = Rails.root.join('app', 'views', "themes", show_page_theme.to_s) prepend_view_path(show_theme_view_path) yield - view_paths = original_paths # rubocop:disable Lint/UselessAssignment + # rubocop:disable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses + # Do NOT change this line. This is calling the Rails view_paths=(paths) method and not a variable assignment. + view_paths=(original_paths) # rubocop:enable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses else yield diff --git a/app/controllers/hyrax/contact_form_controller.rb b/app/controllers/hyrax/contact_form_controller.rb index 9cdbcdc13..17f6cb614 100644 --- a/app/controllers/hyrax/contact_form_controller.rb +++ b/app/controllers/hyrax/contact_form_controller.rb @@ -105,6 +105,7 @@ def inject_theme_views prepend_view_path(home_theme_view_path) yield # rubocop:disable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses + # Do NOT change this line. This is calling the Rails view_paths=(paths) method and not a variable assignment. view_paths=(original_paths) # rubocop:enable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses else diff --git a/app/controllers/hyrax/homepage_controller.rb b/app/controllers/hyrax/homepage_controller.rb index 5afc975bb..a38eda845 100644 --- a/app/controllers/hyrax/homepage_controller.rb +++ b/app/controllers/hyrax/homepage_controller.rb @@ -120,6 +120,7 @@ def inject_theme_views prepend_view_path(home_theme_view_path) yield # rubocop:disable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses + # Do NOT change this line. This is calling the Rails view_paths=(paths) method and not a variable assignment. view_paths=(original_paths) # rubocop:enable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses else diff --git a/app/controllers/hyrax/pages_controller.rb b/app/controllers/hyrax/pages_controller.rb index 74c16fea8..cdfd8d0a7 100644 --- a/app/controllers/hyrax/pages_controller.rb +++ b/app/controllers/hyrax/pages_controller.rb @@ -105,6 +105,7 @@ def inject_theme_views prepend_view_path(home_theme_view_path) yield # rubocop:disable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses + # Do NOT change this method. This is an override of the view_paths= method and not a variable assignment. view_paths=(original_paths) # rubocop:enable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses else