Rails 2.1.1
Among other things, a security fix.
This commit is contained in:
parent
d2c4c8737c
commit
d4f97345db
354 changed files with 21027 additions and 3072 deletions
|
@ -2,22 +2,22 @@ module ActiveResource
|
|||
module Formats
|
||||
module JsonFormat
|
||||
extend self
|
||||
|
||||
|
||||
def extension
|
||||
"json"
|
||||
end
|
||||
|
||||
|
||||
def mime_type
|
||||
"application/json"
|
||||
end
|
||||
|
||||
def encode(hash)
|
||||
|
||||
def encode(hash, options={})
|
||||
hash.to_json
|
||||
end
|
||||
|
||||
|
||||
def decode(json)
|
||||
ActiveSupport::JSON.decode(json)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,23 +2,23 @@ module ActiveResource
|
|||
module Formats
|
||||
module XmlFormat
|
||||
extend self
|
||||
|
||||
|
||||
def extension
|
||||
"xml"
|
||||
end
|
||||
|
||||
|
||||
def mime_type
|
||||
"application/xml"
|
||||
end
|
||||
|
||||
def encode(hash)
|
||||
hash.to_xml
|
||||
|
||||
def encode(hash, options={})
|
||||
hash.to_xml(options)
|
||||
end
|
||||
|
||||
|
||||
def decode(xml)
|
||||
from_xml_data(Hash.from_xml(xml))
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
# Manipulate from_xml Hash, because xml_simple is not exactly what we
|
||||
# want for Active Resource.
|
||||
|
@ -28,7 +28,7 @@ module ActiveResource
|
|||
else
|
||||
data
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue