Permalink
Browse files

return an empty collection, rather than an empty array when there are…

… no results
  • Loading branch information...
1 parent ac7c4c3 commit 56e697f3ee8ffabcdf50130e56b497b2cac66b7e Wesley Beary committed Jul 21, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 adapters/dm-couchdb-adapter/lib/couchdb_adapter.rb
View
2 adapters/dm-couchdb-adapter/lib/couchdb_adapter.rb
@@ -125,7 +125,7 @@ def read_many(query)
end
if doc['rows']
if doc['rows'].empty?
- []
+ Collection.new(query) { [] }
elsif query.view && query.model.views[query.view.to_sym].has_key?('reduce')
doc['rows'].map {|row| OpenStruct.new(row)}
else

0 comments on commit 56e697f

Please sign in to comment.