Abstract: It seems that the AnyModule::AnyModel shadows AnyModel.
Note: a simila post of mine appears in “Rails Engines development” as
I would like to have the model
managed by the controller
I am experimentig a quite strange behavior:
1 - create a test rails application (e.g. tasklist)
2 - setup a db (e.g. tasklist_dev) with a table (e.g. categories)
3 - from RAILS_ROOT
$ ./script generate scaffold category
4 - run the application and
point to http://localhost:3000/categories
you should see the usual good stuff.
5 - $ ./script generate model task_list/category
Now tha application is broken and you get:
“uninitialized constant Category” error.
It seems that the Task_List::Category shadows Category.
Can anybody explain why? Is it already happened to anybody else?