docbrown/config/initializers/liquid.rb
rhymes 36786cf554
Rails 6: enable zeitwerk autoloader (#8766)
* More loading fixes

* Go back to OpenStruct

* Shuffle things around

* Remove obsolete patches and unneeded requires

* Disable config.add_autoload_paths_to_load_path

* Fix pre-require errors

* Config not reloader
2020-06-22 16:27:55 +02:00

14 lines
608 B
Ruby

Rails.application.config.to_prepare do
# Explicitly requiring lib/liquid to make sure that our patches are loaded
# before liquid tags are loaded
Dir.glob(Rails.root.join("lib/liquid/*.rb")).sort.each do |filename|
require_dependency filename
end
# Our custom Liquid tags are registered to Liquid::Template at the bottom of
# each files. Each Liquid tags will need to be loaded/required before the main
# Liquid gem is evoked, hence the need to pre-require them in order
Dir.glob(Rails.root.join("app/liquid_tags/*.rb")).sort.each do |filename|
require_dependency filename
end
end