mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
rename simple adapter to json
This commit is contained in:
@@ -2,7 +2,7 @@ module ActiveModel
|
||||
class Serializer
|
||||
class Adapter
|
||||
extend ActiveSupport::Autoload
|
||||
autoload :SimpleAdapter
|
||||
autoload :JsonAdapter
|
||||
autoload :NullAdapter
|
||||
autoload :JsonApiAdapter
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
class Adapter
|
||||
class SimpleAdapter < Adapter
|
||||
class JsonAdapter < Adapter
|
||||
def serializable_hash(options = {})
|
||||
serializer.attributes.each_with_object({}) do |(attr, value), h|
|
||||
h[attr] = value
|
||||
@@ -6,7 +6,7 @@ module ActiveModel
|
||||
|
||||
included do |base|
|
||||
base.config.array_serializer = ActiveModel::Serializer::ArraySerializer
|
||||
base.config.adapter = :simple
|
||||
base.config.adapter = :json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "active_model"
|
||||
require "active_model/serializer/version"
|
||||
require "active_model/serializer"
|
||||
require "active_model/serializer/adapter/simple_adapter"
|
||||
|
||||
begin
|
||||
require 'action_controller'
|
||||
|
||||
Reference in New Issue
Block a user