mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
@@ -7,9 +7,8 @@ module ActiveModel
|
||||
def initialize(name, options={})
|
||||
@name = name.to_s
|
||||
@options = options
|
||||
|
||||
self.embed = options[:embed] || CONFIG.embed || :objects
|
||||
@embed_in_root = @embed_ids && (options[:include] || CONFIG.include)
|
||||
self.embed = options.fetch(:embed) { CONFIG.embed }
|
||||
@embed_in_root = options.fetch(:include) { CONFIG.include }
|
||||
@embed_key = options[:embed_key] || :id
|
||||
@key = options[:key]
|
||||
@embedded_key = options[:root] || name
|
||||
|
||||
@@ -48,5 +48,6 @@ module ActiveModel
|
||||
end
|
||||
|
||||
CONFIG = Config.new
|
||||
CONFIG.embed = :objects
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user