-
Notifications
You must be signed in to change notification settings - Fork 376
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
Problem with create and relartions #178
Comments
It doesn't seem so. I have to test and see what's going wrong. |
I was re-reading your issue. Your trying to create a user with a roll directly defined in user object, right? You can't do this for now. It should behave as you're showing (it should ignore the |
I think that what you want is what is described in #162, right? |
Well, I understand that the related objects have to be saved with setRols (in this case), but the problem is with the insert statement generated. It contains this field "rols" that is un the object, but not in the definition... |
Yes, that's the only thing I want to check and fix. The other thing I suppose it's the same as the other issue. |
Hello. I have the folowing situation:
model: Rol {id, description}
model: User {name, code, status} asociated with Rol (User hasMany Rol)
When I load the object User (that automatically fetch Rols) I have something like this:
User: {id: 1, name: "asdasd", code: "asdasd", status: 1, rols: [{id: 1, description: "rol 1"}]}
When I create a new object: User.create([model], function ....)
It generates an insert statement like this:
INSERT INTO
user
(code
,name
,status
,rols
) VALUES ('asdasd', 'asdasd', 0, (id
= 2,descripcion
= 'Supervisor'))So the problem is that is trying to insert rols directly into thr user...
Im doing something wrong?
Thanks.
The text was updated successfully, but these errors were encountered: