Closed huyvohcmc closed 3 years ago
What does current_address
relationship look like? Is this current_address_id
in members
table? If so, after the cloning addresses
relation this value will be broken (member.current_address => nil) and you have to restore it (see: https://clowne.evilmartians.io/#/clone_mapper)
Btw, I think the problem here in the validation itself. The job model should not validate third party data, and probably better to move it to the Address
model.
FYI current_address
is just the latest address of the member.
When cloning a member, the cloner will clone jobs and addresses but the cloned job objects will fail to validate because at the time you clone
member.jobs
,member.current_address
(class Address) has not been cloned yet.So, is there any way to making sure we will clone
member.address
first beforemember.jobs
?