This project is archived and is in readonly mode.

#5659 ✓stale
Zachary Crockett

Generating scaffold with uncountable multi-word CamelCase creates bad helper name

Reported by Zachary Crockett | September 19th, 2010 @ 02:44 AM

Alert: Low priority, esoteric, and easy-to-work-around bug. Just use underscore instead.

Steps to reproduce:

First, add artist_info to the uncountable list in config/initializers/inflections.rb, then:

prompt> rails g scaffold ArtistInfo bio:text

   invoke  active_record
   create    db/migrate/20100919012543_create_artist_info.rb
   create    app/models/artist_info.rb
   invoke    test_unit
   create      test/unit/artist_info_test.rb
   create      test/fixtures/artist_info.yml
    route  resources :artist_info
   invoke  scaffold_controller
   create    app/controllers/artist_info_controller.rb
   invoke    erb
   create      app/views/artist_info
   create      app/views/artist_info/index.html.erb
   create      app/views/artist_info/edit.html.erb
   create      app/views/artist_info/show.html.erb
   create      app/views/artist_info/new.html.erb
   create      app/views/artist_info/_form.html.erb
   invoke    test_unit
   create      test/functional/artist_info_controller_test.rb
   invoke    helper
   create      app/helpers/artist_infos_helper.rb
   invoke      test_unit
   create        test/unit/helpers/artist_infos_helper_test.rb
   invoke  stylesheets
identical    public/stylesheets/scaffold.css

Note the names of the helper and the unit test for the helper. Using the following instead works as expected:

rails g scaffold artist_info bio:text

Bug exists on edge rails right now, 18 September 2010.

Related to ticket #4836 the generator does not act as expected if only "info" is added to the uncountable inflections. The generator also doesn't recognize this case if "ArtistInfo" is added to the uncountable inflections. Generating the helper by itself actually works as expected with either

rails g helper artist_info

or

rails g helper ArtistInfo

Comments and changes to this ticket

  • Ryan Bigg

    Ryan Bigg October 11th, 2010 @ 10:54 AM

    • Tag cleared.
    • Importance changed from “” to “Low”

    Automatic cleanup of spam.

  • Ryan Bigg

    Ryan Bigg October 19th, 2010 @ 08:25 AM

    Automatic cleanup of spam.

  • Jeff Kreeftmeijer
  • rails

    rails March 29th, 2011 @ 01:00 AM

    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 29th, 2011 @ 01:00 AM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages