Used by WorkitemDatabase#query
# File lib/ruote/couch/database.rb, line 227
227: def by_wfid (wfid)
228:
229: #get_many(/!#{wfid}$/, {})
230: get_many(wfid, {})
231: end
The get_many used by errors, expressions and schedules.
# File lib/ruote/couch/database.rb, line 216
216: def get_many (key, opts)
217:
218: return super(key, opts) unless key.is_a?(String)
219:
220: # key is a wfid
221:
222: query("_design/ruote/_view/by_wfid?key=%22#{key}%22&include_docs=true")
223: end
# File lib/ruote/couch/database.rb, line 242
242: def design_doc
243:
244: {
245: '_id' => '_design/ruote',
246: 'views' => {
247: 'by_wfid' => {
248: 'map' => %{
249: function (doc) {
250: if (doc.wfid) emit(doc.wfid, null);
251: else if (doc.fei) emit(doc.fei.wfid, null);
252: }
253: }
254: }
255: }
256: }
257: end
# File lib/ruote/couch/database.rb, line 259
259: def prepare
260:
261: d = @couch.get('_design/ruote')
262:
263: return if d && d['views'] == design_doc['views']
264:
265: d ||= design_doc
266: d['views'] = design_doc['views']
267:
268: @couch.put(design_doc)
269: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.