Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5659

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 [PATCH] Inconsistent behavior in pluralizing uncountable words 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

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

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Ryan Bigg
    Ryan Bigg
    • Tag cleared.
    • Importance changed from to Low

    Automatic cleanup of spam.

    October 11th, 2010 @ 10:54 AM

  2. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    October 19th, 2010 @ 08:25 AM

  3. Jeff Kreeftmeijer
  4. rails
    rails
    • 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.

    March 29th, 2011 @ 01:00 AM

  5. rails
    rails
    • State changed from open to stale

    March 29th, 2011 @ 01:00 AM