DEV: explicitly require Rails components

DEV: explicitly require Rails components

rails/all includes too much stuff per: rails/all.rb at master · rails/rails · GitHub

This commit makes it explicit what pieces of Rails Discourse depends on.

Previously the LoadError was protecting us and we were excluding components, using the Gemfile, this method ensures that even if we add rails meta gem as a dependency only the parts of Rails Discourse uses will be used.

diff --git a/config/application.rb b/config/application.rb
index 65233ef..a3ecce5 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -14,7 +14,11 @@ rescue
 end
 
 require File.expand_path('../boot', __FILE__)
-require 'rails/all'
+require 'active_record/railtie'
+require 'action_controller/railtie'
+require 'action_view/railtie'
+require 'action_mailer/railtie'
+require 'sprockets/railtie'
 
 # Plugin related stuff
 require_relative '../lib/discourse_event'

GitHub sha: 15857b90

1 Like