Closed handzlikt closed 1 year ago
When an exception is applied, it assigns the default database value (else nil) to the attribute. I don't see how that could go wrong. It is tested in https://github.com/moiristo/deep_cloneable/blob/master/test/test_deep_cloneable.rb#L15, so I'm assuming for now that something else in your code is preventing the reassignment. If you think that's not the case, I really need a failing test case to be able to reproduce the issue.
Thank you for your response. When trying to prepare the test case I realised there was is a default value applied on that field in our database... Sorry for taking your time.
I have a model that has a 'rank' attribute and I want to exclude it from cloning:
original.deep_clone except: :rank
. But it's still keeping the original rank. It happens on Rails 5.2 with Ruby 2.5 and deep_cloneable 3.2