1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

View file

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