Skip to content

Commit

Permalink
add guard against including associations for nil objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran committed Mar 16, 2016
1 parent b2dc259 commit 82a870d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_model/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def serializable_hash
_serializable_hash
end

include_associations! if _embed
include_associations! if @object.present? && _embed
@node
end

Expand Down

0 comments on commit 82a870d

Please sign in to comment.