discourse/config/initializers/002-freedom_patches.rb
Loïc Guitaut f58b844f45
Revert "DEV: Upgrade Rails to version 7.1" (#27625)
This reverts commit ce00f83173863c3151f21c5cd03f24e3f6617e5c.
2024-06-26 18:55:05 +02:00

14 lines
515 B
Ruby

# frozen_string_literal: true
# Multisite freedom patch defines RailsMultisite::DiscoursePatches.config which is used by 200-first_middlewares.rb
# Therefore it can not be postponed with .to_prepare
RUN_WITHOUT_PREPARE = ["#{Rails.root}/lib/freedom_patches/rails_multisite.rb"]
RUN_WITHOUT_PREPARE.each { |path| require(path) }
Rails.application.reloader.to_prepare do
Dir["#{Rails.root}/lib/freedom_patches/*.rb"].each do |f|
next if RUN_WITHOUT_PREPARE.any? { |path| path == f }
require(f)
end
end