Closed rzane closed 10 years ago
Awesome thanks. Is there some way we could get a test for this?
Also, how does this affect compatibility?
I can definitely add a test tomorrow. Probably should have done that in the first place.
Regarding compatibility, ActiveResource::Collection was added with this PR: https://github.com/rails/activeresource/pull/22 for 4.0.0.beta1. Anything before won't respond_to?(:collection_parser)
, so they'll just return an array. For anyone using ActiveResource less than 4.0 there will be no change at all. ActiveResource::Collection accepts all array instance methods, so this change probably won't hurt anyone w/ ActiveResource greater than 4.0 either.
I've added specs, but the conditional tests feel a bit filthy. Let me know if you would prefer to do that a different way.
Thanks for adding the tests. The conditional is a little filthy, but not something that's making me crazy. I think my defining and undefining of constants was also pretty filthy :) I'll get this merged hopefully later today and then release a new version!
Awesome. Thanks!
Published to RubyGems! Thanks for contributing @rzane!
:+1:
Really useful and easy to use gem. The only issue I'm experiencing is that it makes the resource return an
Array
rather than anActiveResource::Collection
. This is especially an issue when using a custom collection parser that extends the functionality of the list of elements.Example taken from: http://www.rubydoc.info/github/rails/activeresource/ActiveResource/Collection