fixed issue with ActiveRecord serialize object as JSON

fixes #15594
Merge pull request #16059 from jenncoop/json-serialized-attr

Fixed issue with ActiveRecord serialize object as JSON