Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Support for "<<" on associations #31

educobuci opened this Issue · 0 comments

1 participant


I think it would be great to support the "<<" operator on associations since there are many situations where you just want to add an item to an association, today it is only possible to replace all the association items at once.
My first idea was to overwrite the "<<" operator in the ARes association class (is it just an Array?), track all changes made and, in the save method, make a second call to "push" the new items on the association, for instance:

PUT /post/123/comments -d comments[][body]="this is a comment"

Or even add an existent item:

PUT /post/123/comments -d comments[][id]=456

I'm not sure so I was wondering if you have a better solution, maybe I can borrow some ideas from AR. What do you think?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.