Test for SimpleAdapter#serializable_hash

This commit is contained in:
Tema Bolshakov
2014-08-27 09:15:07 +04:00
parent 553c470e10
commit 7b7d4d8907
2 changed files with 10 additions and 2 deletions

View File

@@ -2,10 +2,14 @@ module ActiveModel
class Serializer
class Adapter
class SimpleAdapter < Adapter
def to_json(options={})
def serializable_hash(options = {})
serializer.attributes.each_with_object({}) do |(attr, value), h|
h[attr] = value
end.to_json # FIXME: why does passing options here cause {}?
end
end
def to_json(options={})
serializable_hash(options).to_json
end
end
end