incrdecr_cached_counts 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.rdoc +7 -5
- data/lib/cached_counts/version.rb +1 -1
- metadata +2 -51
- data/html/CachedCounts/ClassMethods.html +0 -960
- data/html/CachedCounts/Railtie.html +0 -102
- data/html/CachedCounts.html +0 -197
- data/html/README_rdoc.html +0 -152
- data/html/created.rid +0 -7
- data/html/css/fonts.css +0 -167
- data/html/css/rdoc.css +0 -590
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +0 -155
- data/html/js/darkfish.js +0 -161
- data/html/js/jquery.js +0 -4
- data/html/js/navigation.js +0 -142
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +0 -109
- data/html/js/search_index.js +0 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +0 -228
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +0 -144
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 033e0da0b3b6191884b1ed3547029daf979e9af7
|
4
|
+
data.tar.gz: b3e5b4e46ac655f2ab54b6b59ce57544b0b11177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d0a1cf6c691aa0f41d86ab72743575d5eb906943eba00295681e033a69d39c2f5bc5d9ab0c0f1865bb387a82d6016ffe2f442844876f8c7bb3375ac11fb665e
|
7
|
+
data.tar.gz: 578b20bd19e73cd0df63d4fbbb99618f7bf7c343b85b049a9560be46ae8e493c746dc835710977440572fe792f6df72a1750fae61dd28fde207e8eaa4268ab65
|
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -8,14 +8,15 @@ cache up to date using incr/decr operations.
|
|
8
8
|
You might prefer this gem over Rails' built-in counter caches when:
|
9
9
|
* You want to cache the total number of models for a class or scope
|
10
10
|
* You have a large association (e.g. followers of a popular figure) and want to avoid contention on a database row
|
11
|
-
* You want your caches to expire and be refreshed to mitigate the risk of getting out of sync
|
11
|
+
* You want your caches to occasionally expire and be refreshed to mitigate the risk of getting out of sync
|
12
12
|
* You don't need to use counts as part of more complex SQL queries
|
13
13
|
|
14
|
-
There are
|
15
|
-
but this gem appears to be unique in making use of memcached's incr/decr operations.
|
14
|
+
There are {many alternatives}[https://rubygems.org/search?utf8=%E2%9C%93&query=counter+cache], but this gem appears to be unique in its approach. Other gems solve the contention issue by pushing updates to a background job, which has the advantage of continuing to populate a column that can be queried via SQL, but is still more costly than our approach, while introducing a synchronization delay.
|
16
15
|
|
17
16
|
= Usage
|
18
17
|
|
18
|
+
{Documentation}[http://academia-edu.github.io/cached_counts/]
|
19
|
+
|
19
20
|
Basic usage:
|
20
21
|
|
21
22
|
class User < ActiveRecord::Base
|
@@ -37,8 +38,9 @@ Basic usage:
|
|
37
38
|
belongs_to :followee, class_name: 'User', # ...
|
38
39
|
end
|
39
40
|
|
40
|
-
|
41
|
-
|
41
|
+
Note that _CachedCounts_ must be included in the counted class, but no class methods need be called there.
|
42
|
+
|
43
|
+
For full options, see docs for _CachedCounts.caches_count_of_ and _CachedCounts.caches_count_where_.
|
42
44
|
|
43
45
|
= Licence
|
44
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incrdecr_cached_counts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Judd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -138,55 +138,6 @@ files:
|
|
138
138
|
- README.rdoc
|
139
139
|
- Rakefile
|
140
140
|
- circle.yml
|
141
|
-
- html/CachedCounts.html
|
142
|
-
- html/CachedCounts/ClassMethods.html
|
143
|
-
- html/CachedCounts/Railtie.html
|
144
|
-
- html/README_rdoc.html
|
145
|
-
- html/created.rid
|
146
|
-
- html/css/fonts.css
|
147
|
-
- html/css/rdoc.css
|
148
|
-
- html/fonts/Lato-Light.ttf
|
149
|
-
- html/fonts/Lato-LightItalic.ttf
|
150
|
-
- html/fonts/Lato-Regular.ttf
|
151
|
-
- html/fonts/Lato-RegularItalic.ttf
|
152
|
-
- html/fonts/SourceCodePro-Bold.ttf
|
153
|
-
- html/fonts/SourceCodePro-Regular.ttf
|
154
|
-
- html/images/add.png
|
155
|
-
- html/images/arrow_up.png
|
156
|
-
- html/images/brick.png
|
157
|
-
- html/images/brick_link.png
|
158
|
-
- html/images/bug.png
|
159
|
-
- html/images/bullet_black.png
|
160
|
-
- html/images/bullet_toggle_minus.png
|
161
|
-
- html/images/bullet_toggle_plus.png
|
162
|
-
- html/images/date.png
|
163
|
-
- html/images/delete.png
|
164
|
-
- html/images/find.png
|
165
|
-
- html/images/loadingAnimation.gif
|
166
|
-
- html/images/macFFBgHack.png
|
167
|
-
- html/images/package.png
|
168
|
-
- html/images/page_green.png
|
169
|
-
- html/images/page_white_text.png
|
170
|
-
- html/images/page_white_width.png
|
171
|
-
- html/images/plugin.png
|
172
|
-
- html/images/ruby.png
|
173
|
-
- html/images/tag_blue.png
|
174
|
-
- html/images/tag_green.png
|
175
|
-
- html/images/transparent.png
|
176
|
-
- html/images/wrench.png
|
177
|
-
- html/images/wrench_orange.png
|
178
|
-
- html/images/zoom.png
|
179
|
-
- html/index.html
|
180
|
-
- html/js/darkfish.js
|
181
|
-
- html/js/jquery.js
|
182
|
-
- html/js/navigation.js
|
183
|
-
- html/js/navigation.js.gz
|
184
|
-
- html/js/search.js
|
185
|
-
- html/js/search_index.js
|
186
|
-
- html/js/search_index.js.gz
|
187
|
-
- html/js/searcher.js
|
188
|
-
- html/js/searcher.js.gz
|
189
|
-
- html/table_of_contents.html
|
190
141
|
- incrdecr_cached_counts.gemspec
|
191
142
|
- lib/cached_counts.rb
|
192
143
|
- lib/cached_counts/connection_for.rb
|