0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 15:18:34 +08:00
discourse/config/initializers/002-freedom_patches.rb
Jarek Radosz 48691ee582
DEV: Enable Rails/FilePath rubocop rule (#40097)
(to be enabled in the shared config)
2026-05-19 19:07:54 +02:00

13 lines
531 B
Ruby
Vendored

# 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.join("lib/freedom_patches/rails_multisite.rb")}"]
RUN_WITHOUT_PREPARE.each { |path| require(path) }
Rails.application.reloader.to_prepare do
Dir["#{Rails.root.join("lib/freedom_patches/*.rb")}"].each do |f|
next if RUN_WITHOUT_PREPARE.any? { |path| path == f }
require(f)
end
end