Class | CouchPotato::View::ModelViewSpec |
In: |
lib/couch_potato/view/model_view_spec.rb
|
Parent: | BaseViewSpec |
A view to return model instances by searching its properties. If you pass reduce => true will count instead
example:
view :my_view, :key => :name
in addition you can pass in conditions as a javascript string
view :my_view_only_completed, :key => :name, :conditions => 'doc.completed = true'
and also a results filter (the results will be run through the given proc):
view :my_view, :key => :name, :results_filter => lambda{|results| results.size}