mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Allow using root = false in initialize
This commit is contained in:
@@ -85,7 +85,8 @@ module ActiveModel
|
||||
alias read_attribute_for_serialization send
|
||||
|
||||
def root=(root)
|
||||
@root = root || self.class._root
|
||||
@root = root
|
||||
@root = self.class._root if @root.nil?
|
||||
@root = self.class.root_name if auto_assign_root?
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user