Skip to content

Commit

Permalink
just return the raw data if there is a reduce function
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley Beary committed Jul 19, 2008
1 parent c89dc08 commit 5dfa4b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adapters/dm-couchdb-adapter/lib/couchdb_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion adapters/dm-couchdb-adapter/spec/couchdb_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5dfa4b4

Please sign in to comment.