Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

just return the raw data if there is a reduce function

  • Loading branch information...
commit 5dfa4b438b4cef0dea18e5cf989b4c5be13ba518 1 parent c89dc08
Wesley Beary authored
View
2  adapters/dm-couchdb-adapter/lib/couchdb_adapter.rb
@@ -121,7 +121,7 @@ def read_many(query)
if doc['rows'].empty?
[]
elsif query.view && query.model.views[query.view.to_sym].has_key?('reduce')
- doc['rows'].first['value']
+ doc['rows']
else
Collection.new(query) do |collection|
doc['rows'].each do |doc|
View
2  adapters/dm-couchdb-adapter/spec/couchdb_adapter_spec.rb
@@ -225,7 +225,7 @@ class Company
it "should return a value from a view with reduce defined" do
pending("No CouchDB connection.") if @no_connection
- User.count.should == User.all.length
+ User.count.should == [ { "value" => User.all.length, "key" => nil } ]
end
def create_procedures
Please sign in to comment.
Something went wrong with that request. Please try again.