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.

ScaffoldGenerator doesn't really handle plurals

#2331

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.

Reported by Ivan · March 24th, 2009 @ 11:43 PM

State: invalid
Milestone: 2.x
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. Steve St. Martin
    Steve St. Martin
    • Assigned user set to Ryan Bigg

    cannot reproduce on 2.3.5, can be marked as invalid

    April 16th, 2010 @ 12:41 AM

  2. Ryan Bigg
    Ryan Bigg
    • State changed from new to invalid

    Me either.

    April 16th, 2010 @ 01:25 AM