-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating mutators with backbone.relational #37
Labels
Comments
Hey, I´m out of the "Backbone Game" for a couple of months now & basically, after grinding my gears a bit, I don't see a chance to incorporate the plugins better (at least not, with digging deeper into the topic, and I don't see time for doing that). That means, if you figure out how to integrate it easier/with less effort, I´m happy to change smth. in the plugin, or accept a PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've faced the following issue while trying to integrate Backbone.Mutators with Backbone.Relational which is used to build client side relations and helps to serialize/deserialize data into corresponding json/models.
For example lets assume we have a model (in coffeescript)
What I have now is trying to access related model in mutator will result in an error. That is because backbone.relational haven't yet converted the model's sub-object into an instance of underlying model at the time backbone.mutators serialize data and hence
@get('location')
will return a json object instead of Entities.Location instance.I've applied a quick fix by changing the library to save
get
andset
methods from Backbone.RelationalModel.However i do not really like this fix as far as i will have to apply it every time Backbone.Mutators is updated. Perhaps someone has a more consistent solution? Also please let me know if you need any additional info.
The text was updated successfully, but these errors were encountered: