Serialize the virtual attributes with a hash