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.

multiparamter_attribute assignment fails when used via assoication

#3131

It seems multiparameter_attributes fail when being assigned via an association proxy.
After some muddling, it turns out the AR::Base#initialize was to blame. The situation seems to be arise when the attributes are associated via some scope. AR::Base#initialize does not support this case.

Luckily def attributes= Does, so I merely extracted the attribute assignment code from def attributes=, into def assigns_attribute.

Now both def attributes= and initialize assign attributes via def assign_attribute.

Problem seems to be solved

The following is a patch for origin/2-3-stable which includes patch and regression test.
If needed I can also throw down a patch for master.

http://gist.github.com/a0401857b8291ea46774

Reported by stefanpenner · September 1st, 2009 @ 09:36 PM

State: resolved
Milestone: 2.3.6
Assigned to: nobody
Importance: none

Activity

  1. stefanpenner
    stefanpenner
    • Tag changed from 2.3.4 to 2.3.4, activerecord, multiparameter_attributes
    • Title changed from multiparameter_attribute assignment fails when used via assoication to multiparamter_attribute assignment fails when used via assoication

    September 1st, 2009 @ 09:44 PM

  2. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3.4, activerecord, multiparameter_attributes to 2.3.4, activerecord, bugmash, multiparameter_attributes

    September 25th, 2009 @ 12:36 PM

  3. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • Milestone set to 2.3.6
    • State changed from new to resolved

    Closed by c362a76d00c9d023e23fb15aae638512a09e2948. This problem cannot be reproduced on master.

    January 3rd, 2010 @ 07:53 AM