This error is bizarre. This error wasted my couple of hours; here is the detail
Here is the situation – I have used STI technique for models like Admin, VO, GO where all are derived from User model.
Lately I added ActiveAdmin plugin in my app and I was required to integrate it using the Admin model of course. For that purpose ActiveAdmin installer created a file called
I suspect that, the similarity of filenames
admin.rb might be the cause of the error. Because, the models and the ruby files in
app/admin dir are lazy-loaded[loaded on need].
When I renamed the file
admins.rb ; then restarted the server, it started working back again.
The cause of this error is found to be the namespace collision. ActiveAdmin creates a module for namespaces (by default Admin). Rails could not find the Admin model but found Admin namespaced-module instead; this is what the error is saying. So, change the namespace like
# # To set no namespace by default, use: # config.default_namespace = false # # Default: config.default_namespace = :admins # instead of :admin