This project is archived and is in readonly mode.

#2331 ✓invalid
Ivan

ScaffoldGenerator doesn't really handle plurals

Reported by Ivan | March 24th, 2009 @ 11:43 PM | in 2.x

The following lines present in scaffold_generator.rb :


if @name == @name.pluralize && !options[:force_plural]
      logger.warning "Plural version of the model detected, using singularized version.  Override with --force-plural."
      @name = @name.singularize
    end

are meant to handle the passing of a model pluralized to the generator. However it isn't completely effective because of class_name which comes from the parent class NamedBase and is used in the templates and thus produces incorrect things like Projects.all in the controller or new_projects_path in the views whereas the model that has been generated is Project.

Comments and changes to this ticket

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>

People watching this ticket

Pages