mongoid_countercache 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 570f444cf6b28f85bf016728681ef70052a65d28
4
- data.tar.gz: 4f5e4dd1bcdb176df1caa02b6b36b3df6870b162
3
+ metadata.gz: c8a7b5a7c0d9f85ad111885359ae1e01a7a8bc37
4
+ data.tar.gz: 0f6c178d6003b8249d14d02609e0356b78745148
5
5
  SHA512:
6
- metadata.gz: 96acfd0997a317342409365038709ac04e4d0973eb5a53ccec44eb9b42ffde6cd4a520dc0d7f7edfdf10b18bcfb84bc16dbf3ea7ae7aff2d0118067e6579b3f2
7
- data.tar.gz: e647b87ec1ab59ec7450e2d6a1129e432a77a09647ee634dec7c8ee65cf4058ddd9d29595ee3e80b2f439f7a739f078471e18a78d7e5deb472f80cabc2d26406
6
+ metadata.gz: 195e301a05b52502a51f521349b47db28ed7fcf47946d00ae706ece7da748619cca0dcefaae71ef1b4b03f1113a0acf81700b83ee33c1f5737facec4f3b88e26
7
+ data.tar.gz: b0de7ee0a326245acabd0c46ef0a7299f565df80f0f51d19d4c7d769d534436bd26474987b54b8c115fd5a6225f474d9eb49776990554656e49b61a9d3884d81
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ services:
6
+ - mongodb
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # MongoidCounterCache
1
+ # MongoidCounterCache [![Build Status](https://travis-ci.org/Intrepidd/mongoid_countercache.png?branch=master)](https://travis-ci.org/Intrepidd/mongoid_countercache)
2
2
 
3
3
  This gem is used to maintain a cached counter of an object's children, this avoids N + 1 queries issues when doing a ``count`` in a loop.
4
4
 
@@ -40,8 +40,7 @@ module Mongoid
40
40
 
41
41
  def update_parent_counter(parent, field, inc, proc = nil)
42
42
  return unless parent && parent[field]
43
- parent[field] += inc if proc.nil? || proc.bind(self).call
44
- parent.save
43
+ parent.inc(field, inc) if proc.nil? || proc.bind(self).call
45
44
  end
46
45
 
47
46
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidCounterCache
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_countercache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Siami
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-03 00:00:00.000000000 Z
11
+ date: 2013-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -95,6 +95,7 @@ extensions: []
95
95
  extra_rdoc_files: []
96
96
  files:
97
97
  - .gitignore
98
+ - .travis.yml
98
99
  - Gemfile
99
100
  - LICENSE.txt
100
101
  - README.md
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  version: '0'
129
130
  requirements: []
130
131
  rubyforge_project:
131
- rubygems_version: 2.0.0
132
+ rubygems_version: 2.0.3
132
133
  signing_key:
133
134
  specification_version: 4
134
135
  summary: A simple counter cache implemented for mongoid, with neat additions such
@@ -139,3 +140,4 @@ test_files:
139
140
  - spec/models/like.rb
140
141
  - spec/models/post.rb
141
142
  - spec/spec_helper.rb
143
+ has_rdoc: