From: Ivo Wever Date: 2011-03-23T20:04:11+09:00 Subject: Workaround for ActiveSupport::OrderedHash YAML bug Hi, I'm looking for a workaround for the problem that you can't roundtrip a Hash with OrderedHashes as keys. The simplest demonstration, using Ruby Enterprise 2011.03 (1.8.7 p334), ActiveSupport 3.0.4: foo = {ActiveSupport::OrderedHash['x', 'y'] => 'z'} => {#"y"}>=>"z"} YAML.dump(foo) => "--- \n!omap ? \n - x: y\n: z\n\n" The YAML that was dumped here is wrong. It should have been: "--- \n? !omap \n - x: y\n: z\n\n" To demonstrate: YAML.load("--- \n!omap ? \n - x: y\n: z\n\n") ArgumentError: syntax error on line 2, col -1: ` - x: y : z ' YAML.load("--- \n? !omap \n - x: y\n: z\n\n") => {#"y"}>=>"z"} This issue is probably related to http://www.ruby-forum.com/topic/215047. Does anyone know a workaround for this. I've been looking into the sources, but I fear it will take me a while to figure it all out and perhaps someone here has a solution at hand? -- Posted via http://www.ruby-forum.com/.