-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check filters after app is initialized
Avoids accessing models that are not loaded yet: `NameError: uninitialized constant Event`
- Loading branch information
Showing
3 changed files
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen-string-literal: true | ||
|
||
Rails.configuration.after_initialize do | ||
# check the filter lists for correctness | ||
if TeSS::Config.solr_enabled && TeSS::Config.solr_facets.present? | ||
TeSS::Config.solr_facets.each_pair do |name, keys| | ||
unknown_facets = Set.new(keys) - name.classify.constantize.facet_keys | ||
|
||
raise "unknown facets defined for #{name}: #{unknown_facets}" if unknown_facets.any? | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.