Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #12 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[PATCH] associate_identification always tries to singularize words

Reported by: k@v2studio.com Assigned to: David
Priority: normal Milestone: 0.8
Component: ActiveRecord Version: 0.7
Severity: normal Keywords: patch
Cc:

Description

associate_identification expects a plural association_id, however when called from has_one or belongs_to, associate_identification is passed a singular form association_id, which is turn it passes to class_name, which always calls Inflector.singularize.

If the association_id is a singular word that matches singularization rule, it'll be wrongly transformed. e.g. "status" => "statu"

associate_identification must be modified to take an excplit parameter denoting the association_id form (singular or plural). has_one and belongs_to must be modified to notify associate_identification about the expected form.

alternatively, has_one and belongs_to could pluralize the parameter before passing it to associate_identification.

Attachments

patch.diff (3.0 kB) - added by k@v2studio.com on 10/12/04 19:58:31.
patch

Change History

10/12/04 19:58:31 changed by k@v2studio.com

  • attachment patch.diff added.

patch

10/12/04 20:01:22 changed by k@v2studio.com

  • owner changed from k@v2studio.com to David.
  • status changed from new to assigned.

patch passes existing tests, no new tests added.

reassigning to david so he can verify the patch.

10/12/04 20:09:45 changed by k@v2studio.com

  • keywords set to patch.
  • summary changed from associate_identification always tries to singularize words to [PATCH] associate_identification always tries to singularize words.

10/17/04 12:54:46 changed by david

  • status changed from assigned to closed.
  • resolution set to fixed.