public
Rubygem
Description: Extras for DataMapper, including bridges to DataObjects::Migrations and Merb::DataMapper
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-more.git
return an empty collection, rather than an empty array when there are no 
results
monki (author)
Mon Jul 21 11:59:17 -0700 2008
commit  56e697f3ee8ffabcdf50130e56b497b2cac66b7e
tree    f0d9867f8a6bfb4a2d2546c4e3fcac7279893f49
parent  ac7c4c301dd07f511cd38d01fa4be762a94891dc
...
125
126
127
128
 
129
130
131
...
125
126
127
 
128
129
130
131
0
@@ -125,7 +125,7 @@ module DataMapper
0
         end
0
         if doc['rows']
0
           if doc['rows'].empty?
0
- []
0
+ Collection.new(query) { [] }
0
           elsif query.view && query.model.views[query.view.to_sym].has_key?('reduce')
0
             doc['rows'].map {|row| OpenStruct.new(row)}
0
           else

Comments

    No one has commented yet.