mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Remove ActiveModel::Serializer.setup
This commit is contained in:
parent
0ba4830dee
commit
832a269e98
@ -4,15 +4,12 @@ require 'active_model/serializer/associations'
|
|||||||
require 'active_model/serializer/configuration'
|
require 'active_model/serializer/configuration'
|
||||||
require 'active_model/serializer/dsl'
|
require 'active_model/serializer/dsl'
|
||||||
|
|
||||||
require 'thread'
|
|
||||||
require 'forwardable'
|
require 'forwardable'
|
||||||
|
|
||||||
module ActiveModel
|
module ActiveModel
|
||||||
class Serializer
|
class Serializer
|
||||||
include Serializable
|
include Serializable
|
||||||
|
|
||||||
@mutex = Mutex.new
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def inherited(base)
|
def inherited(base)
|
||||||
base._root = _root
|
base._root = _root
|
||||||
@ -20,12 +17,6 @@ module ActiveModel
|
|||||||
base._associations = (_associations || {}).dup
|
base._associations = (_associations || {}).dup
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup
|
|
||||||
@mutex.synchronize do
|
|
||||||
yield Configuration.global
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def embed(type, options={})
|
def embed(type, options={})
|
||||||
Configuration.global.embed = type
|
Configuration.global.embed = type
|
||||||
Configuration.global.embed_in_root = true if options[:embed_in_root] || options[:include]
|
Configuration.global.embed_in_root = true if options[:embed_in_root] || options[:include]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user