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