Complex struct encoding fix

[#6077 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Alexey Nayden 2011-01-13 03:17:47 +03:00 committed by Santiago Pastorino
parent d2c17dbd11
commit a9163b547c

@ -153,6 +153,12 @@ def as_json(options = nil) #:nodoc:
end end
end end
class Struct
def as_json(options = nil) #:nodoc:
Hash[members.zip(values)]
end
end
class TrueClass class TrueClass
AS_JSON = ActiveSupport::JSON::Variable.new('true').freeze AS_JSON = ActiveSupport::JSON::Variable.new('true').freeze
def as_json(options = nil) AS_JSON end #:nodoc: def as_json(options = nil) AS_JSON end #:nodoc: