Skip to content

Commit

Permalink
Handle collection hash case by stripping hash for now
Browse files Browse the repository at this point in the history
  • Loading branch information
nesquena committed Apr 14, 2011
1 parent 7b7d3c2 commit 0509c6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rabl/engine.rb
Expand Up @@ -56,7 +56,8 @@ def object(data)
# Sets the object as a collection casted to a simple array
# collection @users
def collection(data)
object(data.to_a)
data = data.respond_to?(:each_pair) ? data.keys.first : data
self.object(data)
end

# Indicates an attribute or method should be included in the json output
Expand Down

0 comments on commit 0509c6a

Please sign in to comment.