-
Notifications
You must be signed in to change notification settings - Fork 38
Some issue with one-to-one relationship #22
Comments
Hi, Could you provide your models definitions, specially the relations part please? Thanks. |
Hi,
|
…d models are linked using there primary key, the owner attribute should not be updated in order to pass the validation Added test cases for #22 issue
I have pushed fixes to the master branch that should fix the issue. Thanks. |
Hi @juban , I am sorry It does not work still, but probably I found a solution to fix the issue. I have added only one condition. It starts with the line "//It needs for excluding scenario like". Thanks.
|
OK. Seems a pretty good fix (better than mine anyway ;) ) |
@juban and what about save recursivly childs relations? For example, if main model have child relations and child relations have relations for save too? In my case, i have errors if i try to validate main model, beciuse in beforeValidation you do saving children models. Did you test with case? Thank U for answer! |
Hi, @sem-soft. Could you please clarify the relationship between the main model and the children? |
Hi @sem-soft, Could you open a new issue and provide your use case scenario along with models definitions please? Thanks. |
Hi, @mythicallage. Yes, shure! MainModel has many ChildModel, ChildModel has one SubChildModel. And when I tried to save MainModel AR-instance, i've got an error. Hi, @juban, Thx. |
I've made some improvements to cover more hasOne scenarios. Thx. |
Hi @juban . It works fine. Thank you. |
Thx. |
Thank you for your useful extension. I would like to give you feedback to enhance your extension. Version is 1.3.1.
I have some issue with saving new models Dummy and DummyBrother if I try to save with validation. There will be an SQL error anyway. Saving Dummy and DummyMany models works fine.
I have to save Dummy model without validation. It works if I do only like that.
I would be grateful if this case would be considered in tests.
The text was updated successfully, but these errors were encountered: