rails_admin: Circular dependency detected while autoloading constant

Hi,

I have a rails 4 project, with mongoid that mounts an grape api:

mount MyProject::API => '/'

When accessing <site>/admin I get the following exception:

RuntimeError (Circular dependency detected while autoloading constant Api):

When I remove the /app/api folder from autoload path all seems to work correctly (except the api of course)

Can you please give me some pointers for this issue?

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 26 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@steverob ok, explicitly whitelisting my models in config/initializers/rails_admin.rb seems to solve this issue (I should have tried @balauru’s advice first):

# Include specific models (exclude the others):
config.included_models = ['User', 'Product']