Reputation: 3034
It seems to me that it is possible to break ruby on rails such that neither scaffolding works anymore nor database migration when particular model names are used.
In particular I noticed this when using "Dispatcher" for a model to be created via scaffold. If I created the same object with a different name everything works fine.
Has anybody made similar experiences, or is there a list of names not to be used?
Thanks
Upvotes: 3
Views: 465
Reputation: 2872
Official list of reserved words in Rails: http://wiki.rubyonrails.org/rails/pages/reservedwords
"dispatcher" is listed under "Other Names Reported to Have Caused Trouble"
Upvotes: 7
Reputation: 9507
Dispatcher is a class defined by Rails under ActionController - so you're hitting a conflict with the Rails class.
In a Rails console:
>> Dispatcher
=> ActionController::Dispatcher
If you want to use the class name Dispatcher you can namespace it in a Module although it is probably better not to use a name that conflicts with a base Rails class.
Upvotes: 2