11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/boombera/information.rb', line 11
def design_doc
{
'_id' => '_design/boombera',
'language' => 'javascript',
'gem_version' => version,
'views' => {
'content_paths' => {
'map' => " function(doc) {\n if (doc['type'] && doc.type == 'content_item') {\n if (doc['maps_to']) {\n emit(doc._id, doc.maps_to);\n } else {\n emit(doc._id, doc._id);\n }\n }\n }\n EOF\n },\n 'map_references' => {\n 'map' => <<-EOF\n function(doc) {\n if(doc['maps_to'] && doc.maps_to != doc._id) {\n emit(doc.maps_to, doc._id);\n }\n }\n EOF\n }\n }\n }\nend\n"
|