Permalink
Browse files

Fix bug requiring empty hash passed to last call of chained relations…

…hips.
  • Loading branch information...
1 parent fd02f4a commit e317521e5095c83b7bfab12df8789034260cff51 @BinaryPaean committed Aug 9, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/dm-serializer/to_json.rb
@@ -40,6 +40,7 @@ def as_json(options = {})
# #to_yaml
if options[:relationships]
options[:relationships].each do |relationship_name, opts|
+ opts ||= {}
if respond_to?(relationship_name)
result[relationship_name] = __send__(relationship_name).to_json(opts.merge(:to_json => false))
end

0 comments on commit e317521

Please sign in to comment.