Hey Discourse Plugin Gurus,
Just a quick question about Discourse plugins and Rails initializers.
If a Discourse plugin has a directory called “config” and a subdirectory under “config” called “initializers” does the Discourse Rails app read all the plugin initializer files under the “initializers” directory like Rails 6 does?
The reason I ask is that I’m in the middle of writing a “back office” Rails 6 application (Rails only, no EmberJS or other JS framework on top) from scratch for a client and I have a directory under initializers like this:
./config/initializers/client/
… and all the initializers unique to the client are in the “client” subdirectory.
Rails 6 reads all files under the standard initializers directory (even subdirectories); and so I was wondering if Discourse plugins, with a similar directory structure for initializers, will behave as Rails 6 does and read all the initializers in the plugin in a manner like this:
./plugins/my_plugin/config/initializers/myclient/
client_initializer1.rb
client_initializer2.rb
client_initializer2.rb
… without registering these assets in the plugin.rb file?
Thanks!
PS: I looked in about 10 Discourse plugins on GitHub and none of the ones I looked at had initializers under the config directory. That’s why I decided to post the question (and my Rails dev environment is not set up for Discourse at the moment, it’s all setup for the client).