Closed AskarZinurov closed 8 years ago
In essence, you've replaced write_attribute
by raw_write_attribute
, right? I'll check out your code later so I can test the differences. Unfortunately the Travis build fails now, do you think you can fix that?
@moiristo yes, seems like default attributes saved in raw format in table definition and cannot be written as is in general. The fails can be rails issue - the modern versions 4.1, 4.2 works fine, The workaround can be just not specifying attribute type for serialization, as I done here
I tried the code and it works fine for me. As you suggested, I removed the attribute type to keep Travis happy. Thanks for the PR!
Sometimes it is useful to set default serialized attributes in db level. Rails caches this nicely, but deep clone fails. This is bugfix.