Skip to content

HMP with accepts_nested_attributes_for breaks when assigning nested attributes #11

@brettdh

Description

@brettdh

In ActiveRecord's accepts_nested_attributes_for, it uses a case statement on the reflection macro to determine the association type, and predictably, it doesn't include :has_many_polymorphs, which results in a call to a nonexistent method.

See my fork for a failing test case and possible fix for Rails 2.3.5 (test fails on master, succeeds on nested_attributes_fix branch): http://github.com/brettdh/has_many_polymorphs

I'm a Rails neophyte, so I'm not sure what would be The Right Way to fix this, since the fix requires a complete override of the relevant methods. How might I go about keeping such an override working over different Rails versions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions