couch_potato 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changes
2
2
 
3
+ ### 0.5.6
4
+
5
+ * remove the stale parameter from a view query if it's nil, as couchdb only allows stale to be ok or update\_after (langalex)
6
+
3
7
  ### 0.5.5
4
8
 
5
9
  * support for split_design_documents_per_view (jweiss)
data/README.md CHANGED
@@ -21,7 +21,7 @@ Lastly Couch Potato aims to provide a seamless integration with Ruby on Rails, e
21
21
  ### Supported Environments
22
22
 
23
23
  * Ruby 1.8.7, 1.9.2
24
- * CouchDB 1.0.2
24
+ * CouchDB 1.1.0
25
25
 
26
26
  (Supported means I run the specs against those before releasing a new gem.)
27
27
 
@@ -1,3 +1,3 @@
1
1
  module CouchPotato
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
@@ -32,7 +32,11 @@ module CouchPotato
32
32
  def normalize_view_parameters(params)
33
33
  normalized_params = params.dup
34
34
  hash = wrap_in_hash params
35
- replace_range_key hash
35
+ remove_nil_stale(replace_range_key(hash))
36
+ end
37
+
38
+ def remove_nil_stale(params)
39
+ params.reject{|name, value| name.to_s == 'stale' && value.nil?}
36
40
  end
37
41
 
38
42
  def wrap_in_hash(params)
@@ -32,6 +32,11 @@ describe CouchPotato::View::BaseViewSpec, 'initialize' do
32
32
  }
33
33
  }.should_not raise_error
34
34
  end
35
+
36
+ it "should remove stale when it's nil" do
37
+ spec = CouchPotato::View::BaseViewSpec.new Object, 'all', {}, {:stale => nil}
38
+ spec.view_parameters.should == {}
39
+ end
35
40
 
36
41
  it "should convert a range passed as key into startkey and endkey" do
37
42
  spec = CouchPotato::View::BaseViewSpec.new Object, 'all', {}, {:key => '1'..'2'}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: couch_potato
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.5
5
+ version: 0.5.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alexander Lang