mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Don't fail if object is nil, render null
This commit is contained in:
@@ -267,6 +267,7 @@ module ActiveModel
|
||||
# Returns a hash representation of the serializable
|
||||
# object without the root.
|
||||
def serializable_hash
|
||||
return nil if @object.nil?
|
||||
instrument(:serialize, :serializer => self.class.name) do
|
||||
@node = attributes
|
||||
instrument :associations do
|
||||
|
||||
Reference in New Issue
Block a user