data.to_yaml should already be String, please check if we need to cast with "#{...}" - this is the also old code, which needs to be polished..