Module CouchRest::Model::Designs::ClassMethods
In: lib/couchrest/model/designs.rb

Methods

Public Instance methods

The models number of documents to return by default when performing pagination. Returns 25 unless explicitly overridden via paginates_per

Define a Design Document associated with the current model.

This class method supports several cool features that make it much easier to define design documents.

Adding a prefix allows you to associate multiple design documents with the same model. This is useful if you‘d like to split your designs into seperate use cases; one for regular search functions and a second for stats for example.

   # Create a design doc with id _design/Cats
   design do
     view :by_name
   end

   # Create a design doc with id _design/Cats_stats
   design :stats do
     view :by_age, :reduce => :stats
   end

Override the default page pagination value:

  class Person < CouchRest::Model::Base
    paginates_per 10
  end

[Validate]