This project is archived and is in readonly mode.

#6528 ✓wontfix
Emil Loer

Bad singularization when creating scaffold for "anamnesis"

Reported by Emil Loer | March 4th, 2011 @ 09:02 PM

I want to create a scaffold for a model named Anamnesis, which is a medical term (see for more info).

Now, the plural form for anamnesis is anamneses, and Rails handles this correctly. However, in the controller you can see that Rails tries to derive a singular form of the plural form again and it thinks it should be "anamnese", which is wrong. What happens then is that some parts of the controller refer to variables named anamnesis while others refer to variables named anamnese, and this causes the controller to be unable to store data.

Steps needed to reproduce erratic behaviour:

  1. rails new myapp
  2. rails g scaffold anamnesis myfield:string
  3. rake db:migrate
  4. start a server and create an anamnesis
  5. notice that myfield was not stored

Comments and changes to this ticket

  • Andrew White

    Andrew White March 4th, 2011 @ 09:28 PM

    • State changed from “new” to “wontfix”
    • Importance changed from “” to “Low”

    Edit your inflections.rb initializer to add any custom inflections required by your application, e.g:

    # config/initializers/inflections.rb
    ActiveSupport::Inflector.inflections do |inflect|
      inflect.irregular 'anamnesis', 'anamneses'

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=""></a>