platanus / angular-restmod

Rails inspired REST-API ORM for Angular
http://platanus.github.io/angular-restmod/
MIT License
1.18k stars 87 forks source link

Make it possible to put records in multiple collections. #388

Closed werner291 closed 8 years ago

werner291 commented 8 years ago

Hi!

With this change, the RecordAPI now has a $in_collections property which is an array that stores references to all collections the record is in, instead of relying on the $position, which will never work with multiple collections.

I'm not sure whether this change fits inside the design philosophy, so feel free to reject the pull request, but it solves #387 as far as I can tell, and I'm using it in my own projects.

Thanks for a great library!

werner291 commented 8 years ago

Hi, please note that failed checks were due to test browsers not starting, nothing points to my code as far as I can tell.

werner291 commented 8 years ago

Hi, turns out, I'm an idiot: making the records reference the collection makes it retained in memory even if the collection itself goes out of scope. Please reject this Pull request.