Merge pull request #213 from michihuber/fix_rendering_nil_with_custom_serializer

Fix rendering nil with custom serializer
This commit is contained in:
Steve Klabnik
2013-03-05 15:54:51 -08:00
3 changed files with 37 additions and 0 deletions

View File

@@ -274,6 +274,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