Closed KranthiKishore closed 8 years ago
There are validation errors on the associations, so you should check what's wrong there:
copy.relationships.map{|rs| rs.errors.full_messages }
copy.relationships.map{|rs| rs.errors.full_messages } => [["Customer segments can't be blank"]]
This is the error am getting. Which means customer_segment should be created before my relationship is getting created. Any way is there to handle this situation?
You should include those associations as well and if needed you should use a dictionary: https://github.com/moiristo/deep_cloneable#the-dictionary-object-reusage. You can also do it manually after the clone has been created.
Hi,
I'm facing an issue when cloning an object and its associations which is explained here http://stackoverflow.com/questions/32633130/deep-clonable-associated-records-validation-issue.
Can someone help me