I'm not sure about other web servers, but I believe you can do this in your Unicorn or Puma configuration in an "after_fork" hook (in Puma it is on_worker_boot)
You can establish AR connection here, pass it any configuration you want, as well as run your special command.
Since this is correctly part of the configuration of Ruby web server level (Webbrick, Unicorn, Puma, etc), I would say if it can be done there it should stay out of Rails core itself.
see
https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#config
-Jason
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-co...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/rubyonrails-core.
> For more options, visit
https://groups.google.com/d/optout.
----
Jason Fleetwood-Boldt
te...@datatravels.com
http://www.jasonfleetwoodboldt.com/writing
If you'd like to reply by encrypted email you can find my public key on
jasonfleetwoodboldt.com (more about setting GPG:
https://gpgtools.org)