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
relation should be able to get content from model attribute different then 'key' #60
Comments
Why do you want this, instead of just using |
to differentiate ID field (named itemId) from Model field (item). |
+1 for this. I am working with a rails backend, and by convention they provide the id in the _id field (or _ids for a many), while the models themselves come via Its a great lib, I am working on a more Rails like interface to put above it, and I am going to try monkey patching it to get the desired behavior. |
Okay, sounds like a good feature to me and I have some time to do this. Would
|
As for me "serializationKey" is somewhat opposite to original case (deserialization) and also is too long to type. |
Hmm.. |
I think I like |
I'm having model like
Then I init this model with following JSON:
So relation key is different from an attribute where ID is stored.
But I still want to keep relations - so when I change itemId - item will change. And vice versa - when I change item.id I'd like to update itemId attribute
What's the best way to get this behavior? I'm thinking on creating new Relation type that will have keyContentsAttribute option that will specify which model attribute to use. Is there better approach?
The text was updated successfully, but these errors were encountered: