fixed issue with ActiveRecord serialize object as JSON

fixes #15594