I have a multi-tenant application where each tenants information is stores in the database.
I have some variables in the environment configs (development.rb, production.rb) which I want to populate with data from the DB.
Trying to call the model doesn't seem to work.
Is there a way to call a model in the application initializer?
Edit:
Here is the code:
# production.rb
Rails.application.configure do {
config.custom_variable = MyModel.myattribute
}
This returns a ActiveRecord::ConnectionNotEstablished
error