couch_view 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/couch_view/proxy.rb +1 -0
- data/readme.markdown +4 -4
- metadata +4 -4
data/lib/couch_view/proxy.rb
CHANGED
data/readme.markdown
CHANGED
@@ -255,7 +255,7 @@ You can also make your `map_by_label` and `count_by_label` return immediately by
|
|
255
255
|
|
256
256
|
## Arbitrary Reduce
|
257
257
|
|
258
|
-
You can add any arbitrary reduce onto your view by using the `reduce` class method. Just make sure to group it with a map by placing them both
|
258
|
+
You can add any arbitrary reduce onto your view by using the `reduce` class method. Just make sure to group it with a map by placing them both within a `couch_view` block:
|
259
259
|
|
260
260
|
```ruby
|
261
261
|
class Article < CouchRest::Model::Base
|
@@ -263,7 +263,7 @@ You can add any arbitrary reduce onto your view by using the `reduce` class meth
|
|
263
263
|
|
264
264
|
property :label
|
265
265
|
|
266
|
-
|
266
|
+
couch_view do
|
267
267
|
map :label
|
268
268
|
reduce <<-JS
|
269
269
|
function(key, values){
|
@@ -287,13 +287,13 @@ Note that you can still call `map_by_label` as well. You can't, however, call `c
|
|
287
287
|
|
288
288
|
As you've seen, `CouchView` will generate names for your views based on the properties being mapped (or based on the name of the `CouchView::Map` class passed to `map`).
|
289
289
|
|
290
|
-
You can override this default name by passing a name to the `
|
290
|
+
You can override this default name by passing a name to the `couch_view` method:
|
291
291
|
|
292
292
|
```ruby
|
293
293
|
class Article < CouchRest::Model::Base
|
294
294
|
include CouchView
|
295
295
|
|
296
|
-
|
296
|
+
couch_view :over_label do
|
297
297
|
map :label
|
298
298
|
end
|
299
299
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couch_view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Parker
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-17 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: couchrest
|