This project is archived and is in readonly mode.

#2394 ✓stale
Ilya Sabanin

[PATCH] Support for loading nested arrays, numbers and symbols in ActiveResource

Reported by Ilya Sabanin | April 1st, 2009 @ 06:11 PM | in 3.x

It appeared that ActiveResource can't load a nested array, only a flat array of strings (and not even array of numbers).

Check out:


# given that person is an ActiveResource object
person.load {:items => [['first', 'black'], ['second', 'red']]
# => ArgumentError: expected an attributes Hash, got ["first", "black"]

The patch attached to the ticket contains a fix and a test case. Works very well for me. It can load infinitely nested arrays.

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

Pages