I’m upgrading to the latest version of ActiveAdmin and am running into the following when trying to start the app:
Expected ../app/model/store/base.rb to define Base
base.rb defines base like:
module MyApp
class Store::Base
end
end
I've done some digging and found that ActiveAdmin did some refactoring to derive everything from a BaseController. It also depends on another gem (InheritedResources), which does:
self.resource_class ||= begin
namespaced_classes = self.name.sub(/Controller/, ‘’).split(‘::’)
namespaced_class = [namespaced_classes.first, namespaced_classes.last].join(‘::’).singularize
namespaced_class.constantize
rescue NameError
nil
end
So I guess Rails is trying to load the model Base and is wrongly deciding that my existing base.rb file should take precedence or something, but since it’s not namespaced to just Base it raises this error.
How can I fix this? I’ve tried loading the ActiveADmin BaseController file in application.rb, defining a pseudo Base class deriving from BaseController, etc., but nothing seems to work.