creating flatten_json adapter

This commit is contained in:
João Moura
2015-06-13 15:02:11 -03:00
parent 37114e9d5b
commit 5932da64ef
3 changed files with 20 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
require 'active_model/serializer/adapter/json/fragment_cache'
module ActiveModel
class Serializer
class Adapter
class FlattenJson < Json
def serializable_hash(options = {})
super
@result
end
end
def fragment_cache(cached_hash, non_cached_hash)
Json::FragmentCache.new().fragment_cache(cached_hash, non_cached_hash)
end
end
end
end