Scott Johnson
2009-Oct-02 01:07 UTC
Model generator doesn''t properly check for class collisions
If I build a model named ''Config'', things break. The model generator is supposed to prevent name collisions like this (class_collisions in lib/rails_generator/commands.rb) but for some reason it''s never checking for collisions with Config, only with ConfigTest. Note: the rspec_model generator does properly fail with a collision in this case. This is on Rails 2.3.4. To reproduce: script/generate scaffold config name:string Then try to view /configs in the browser: NoMethodError in ConfigsController#index undefined method `all'' for Config:Module
Michael Koziarski
2009-Oct-14 21:57 UTC
Re: Model generator doesn''t properly check for class collisions
> This is on Rails 2.3.4. To reproduce: > script/generate scaffold config name:string > > Then try to view /configs in the browser: > > NoMethodError in ConfigsController#index > > undefined method `all'' for Config:ModuleAre you able to reproduce this on master? Both the generators and the collision detection have been heavily enhanced and it looks like that''ll catch them here? -- Cheers Koz