This project is archived and is in readonly mode.
[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
-
Ilya Sabanin April 1st, 2009 @ 07:11 PM
Here is one more patch that adds support for Numbers and Symbols in arrays that ActiveResource can load. Right now you can only load an arrays of strings, nothing else.
That new patch should be after the previous "nested_arrays_support_for_ares.diff" one because it's using the code introduced in that patch.
Tests are also included.
-
Ilya Sabanin April 1st, 2009 @ 07:11 PM
- Title changed from Support for loading nested arrays in ActiveResource to Support for loading nested arrays, numbers and symbols in ActiveResource
-
Ilya Sabanin April 1st, 2009 @ 07:12 PM
- Title changed from Support for loading nested arrays, numbers and symbols in ActiveResource to [PATCH] Support for loading nested arrays, numbers and symbols in ActiveResource
-
closer April 3rd, 2009 @ 04:45 PM
+1, I think it is time to fix absurd mistakes and don't move them to 3.x release :)
-
Ilya Sabanin April 18th, 2009 @ 02:54 PM
- Tag changed from active_resource, patch, tested to 2-3-stable, active_resource, patch, tested
-
Zach Brock April 20th, 2009 @ 12:20 AM
- Tag changed from 2-3-stable, active_resource, patch, tested to 2-3-stable, active_resource, patch, tested, verified
-
Ilya Sabanin October 24th, 2010 @ 05:33 PM
- Importance changed from to
The problem is not reproducible in Rails 3 anymore, looks like the problem was fixed. We can close this out.
-
Santiago Pastorino February 2nd, 2011 @ 04:28 PM
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino February 2nd, 2011 @ 04:28 PM
- State changed from open to stale
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>