Permalink
Browse files

Fixing issue with :reduce symbol in views

  • Loading branch information...
1 parent 856fe25 commit 02a6413cb938d83e2c8dcca6bec05adb63cfcb8b @samlown samlown committed Apr 8, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 history.txt
  3. +1 −1 lib/couchrest/design.rb
  4. +1 −0 spec/couchrest/design_spec.rb
View
1 .gitignore
@@ -2,4 +2,5 @@
html/*
pkg
*.swp
+*.gem
Gemfile.lock
View
2 history.txt
@@ -1,4 +1,4 @@
-== 1.1.0.rc
+== 1.1.0.pre - 2011-04-08
* Major changes
* Time#to_json monkey patch removed! Standard JSON methods now used instead.
View
2 lib/couchrest/design.rb
@@ -46,7 +46,7 @@ def view_on db, view_name, query = {}, &block
query = view_defaults(view_name).merge(query)
# Ensure reduce is set if dealing with a reduceable view
# This is a requirement of CouchDB.
- query['reduce'] ||= false if can_reduce_view?(view_name)
+ query[:reduce] ||= false if can_reduce_view?(view_name)
db.view(view_slug, query, &block)
end
View
1 spec/couchrest/design_spec.rb
@@ -189,6 +189,7 @@
@des['views']['by_code']['couchrest-defaults'].should be_nil
end
it "should include reduce parameter in query" do
+ # this would fail without it
res = @des.view :by_code
res["rows"][0]["key"].should == 'a'
end

0 comments on commit 02a6413

Please sign in to comment.