Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STI model with autoload_paths, rails_admin will throw Circular dependency error #2260

Closed
TangMonk opened this issue Apr 18, 2015 · 1 comment

Comments

@TangMonk
Copy link

I have some STI model, and place theme in modes/product

$ ls models/product
product.rb
jianpianyi_product.rb # inherit product.rb
wash_product.rb # inherit product.rb 

and add config.autoload_paths += Dir[Rails.root.join('app', 'models', '**')] to application.rb

then refresh admin page (http://localhost:3000/admin/product), will throw

image

@TangMonk TangMonk changed the title add model to autoload_paths, rails_admin will throw Circular dependency error STI model to autoload_paths, rails_admin will throw Circular dependency error Apr 18, 2015
@TangMonk TangMonk changed the title STI model to autoload_paths, rails_admin will throw Circular dependency error STI model WITH autoload_paths, rails_admin will throw Circular dependency error Apr 18, 2015
@TangMonk TangMonk changed the title STI model WITH autoload_paths, rails_admin will throw Circular dependency error STI model with autoload_paths, rails_admin will throw Circular dependency error Apr 18, 2015
@mshibuya
Copy link
Member

Models are meant to be eager-loaded, not auto-loaded.
#3373 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants