Dynamically reloading rails_admin model concerns in development

Here’s the scenario:

  • You’re using the rails_admin gem in your Rails ~6 project
  • You’re configuring your models for rails_admin via concerns, or placing your configuration directly on the model.
  • You don’t want to have to restart your server every time you make a change to your model config (or general rails_admin config)

To give an example of the second point, here’s an example model group.rb and it’s related admin concern…