How to run rails initialization code that relies on all classes being loaded?
I have some crucial application setup code that I want to run once on application spinup that requires iterating through classes of a certain type and calling a gem specific initialize method on them.
According to https://stackoverflow.com/questions/56402093/how-can-i-preload-concerns-in-a-rails-initializer-using-rails-6-zeitwerk I should not autoload constants in initializers.
So how can I run code once on application load after classes are loaded
I tried with no luck:
config.after_initialize do # do stuff end
Huh, bro, I had the same issue. I've starting to use Salesforce recently and I realized that the program was good, but it was working not in full power. So, I was thinking about how to make it more profitable and found a service for customizing salesforce. It helped me so much, man. If you will ever use this CRM, you'd better adapt it for your business.