langalex-couch_potato 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 5
4
+ :patch: 6
@@ -32,7 +32,7 @@ module CouchPotato
32
32
 
33
33
  def process_results(results)
34
34
  if count?
35
- results['rows'].first['value']
35
+ results['rows'].first.try(:[], 'value') || 0
36
36
  else
37
37
  results['rows'].map do |row|
38
38
  klass.json_create row['doc']
@@ -44,6 +44,10 @@ describe 'view' do
44
44
  CouchPotato.database.view(Build.count(:reduce => true)).should == 1
45
45
  end
46
46
 
47
+ it "should count zero documents" do
48
+ CouchPotato.database.view(Build.count(:reduce => true)).should == 0
49
+ end
50
+
47
51
  describe "properties defined" do
48
52
  it "should assign the configured properties" do
49
53
  CouchPotato.couchrest_database.save_doc(:state => 'success', :time => '2008-01-01', :ruby_class => 'Build')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: langalex-couch_potato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang