This project is archived and is in readonly mode.

#3131 ✓resolved
stefanpenner

multiparamter_attribute assignment fails when used via assoication

Reported by stefanpenner | September 1st, 2009 @ 09:36 PM | in 2.3.6

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

Comments and changes to this ticket

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages