Skip to content

Commit

Permalink
Fix loading custom states in theme
Browse files Browse the repository at this point in the history
Let Zeitwerk ignore files which don't match the expected file structure.

Fixes: mysociety/asktheeu-theme#124

Credit to @laurentS for working out the issue in #7917
  • Loading branch information
gbp committed Oct 11, 2023
1 parent 07280c6 commit 382ce29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/initializers/theme_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def require_theme(theme_name)

require theme_main_include

# Let Zeitwerk ignore files which don't match the expected file structure
Rails.autoloaders.main.ignore(theme_lib.join('customstates.rb'))

Rails.configuration.paths['config/refusal_advice'].push(
root.join('config/refusal_advice')
)
Expand Down

0 comments on commit 382ce29

Please sign in to comment.