Class: SimplyStored::Couch::Views::ArrayPropertyViewSpec
- Inherits:
-
CouchPotato::View::ModelViewSpec
- Object
- CouchPotato::View::ModelViewSpec
- SimplyStored::Couch::Views::ArrayPropertyViewSpec
- Defined in:
- lib/simply_stored/couch/views/array_property_view_spec.rb
Instance Method Summary (collapse)
Instance Method Details
- (Object) map_function
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/simply_stored/couch/views/array_property_view_spec.rb', line 5 def map_function "function(doc) { if(doc.ruby_class && doc.ruby_class == '#{@klass.name}') { if (#{formatted_key(key)}.constructor.toString().match(/function Array()/)) { for (var i in #{formatted_key(key)}) { emit(#{formatted_key(key)}[i], 1); } } else { emit(#{formatted_key(key)}, 1); } } }" end |