# Rails bug or breaking convention?

**URL:** <https://www.ruby-forum.com/t/rails-bug-or-breaking-convention/140497>\
**Category:** Rails\
**Created:** [June 15, 2008, 1:50am UTC](https://www.ruby-forum.com/t/rails-bug-or-breaking-convention/140497 "2008-06-15T01:50:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [June 15, 2008, 1:50am UTC](https://www.ruby-forum.com/t/rails-bug-or-breaking-convention/140497/1 "2008-06-15T01:50:36Z")

</div>

## I had a unique instance where I needed a model called “MRA”. When I built my scaffolded resource I get the following:

## mwilliams@Danzig:~/Documents/Projects/TestApp$ ruby script/generate scaffold MRA exists app/models/ exists app/controllers/ exists app/helpers/ create app/views/mr\_as exists app/views/layouts/ exists test/functional/ exists test/unit/ exists public/stylesheets/ create app/views/mr\_as/index.html.erb create app/views/mr\_as/show.html.erb create app/views/mr\_as/new.html.erb create app/views/mr\_as/edit.html.erb create app/views/layouts/mr\_as.html.erb create public/stylesheets/scaffold.css create app/controllers/mr\_as\_controller.rb create test/functional/mr\_as\_controller\_test.rb create app/helpers/mr\_as\_helper.rb route map.resources :mr\_as dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/mra.rb create test/unit/mra\_test.rb create test/fixtures/mras.yml create db/migrate create db/migrate/20080614234404\_create\_mras.rb mwilliams@Danzig:~/Documents/Projects/TestApp$

Notice how it handled the controller and views file names. It split  
the name of the Model because (I’m making an assumption) that it’s  
treating the model like a name. So “Mr.” or “Mrs.”.

What’s worse, is if I try to continue working, I can’t create any more  
scaffolded resources

* * *

## mwilliams@Danzig:~/Documents/Projects/TestApp$ ruby script/generate scaffold Product /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active\_support/ dependencies.rb:261:in `load_missing_constant': Expected /home/ mwilliams/Documents/Projects/TestApp/app/helpers/mr_as_helper.rb to define MrAsHelper (LoadError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/dependencies.rb:467:in`const\_missing’ from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active\_support/dependencies.rb:479:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/inflector.rb:283:in`constantize’ from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active\_support/core\_ext/string/inflections.rb:143:in `constantize' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/helpers.rb:133:in`helper’ from /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action\_controller/helpers.rb:111:in `each' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/helpers.rb:111:in`helper’ from /usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action\_controller/helpers.rb:116:in `helper' ... 27 levels... from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/generate.rb: 1 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’ from /usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in `require’ from script/generate:3 mwilliams@Danzig:~/Documents/Projects/TestApp$

## It even breaks migrations:

## mwilliams@Danzig:~/Documents/Projects/TestApp$ rake db:migrate (in /home/mwilliams/Documents/Projects/TestApp) rake aborted! Expected /home/mwilliams/Documents/Projects/TestApp/app/helpers/ mr\_as\_helper.rb to define MrAsHelper

Is this a bug or is it breaking convention creating a model of all  
capital letters (thought my case for creating an MRA model seems  
legit).

I’ve created a ticket for the bug. Feel free to chime in or build a  
patch (I may attempt to do so).

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [June 15, 2008, 1:52am UTC](https://www.ruby-forum.com/t/rails-bug-or-breaking-convention/140497/2 "2008-06-15T01:52:56Z")

</div>

[http://rails.lighthouseapp.com/projects/8994/tickets/408-generating-a-scaffold-resource-named-mr-confuses-breaks-the-generator#ticket-408-1](http://rails.lighthouseapp.com/projects/8994/tickets/408-generating-a-scaffold-resource-named-mr-confuses-breaks-the-generator#ticket-408-1)

URL to the ticket…

On Jun 14, 7:49 pm, Matthew W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
