Module: CouchRest::Model::Designs::ClassMethods

Defined in:
lib/couchrest/model/designs.rb

Instance Method Summary collapse

Instance Method Details

#default_per_pageObject

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



46
47
48
# File 'lib/couchrest/model/designs.rb', line 46

def default_per_page
  @_default_per_page || 25
end

#design(*args, &block) ⇒ Object

Add views and other design document features to the current model.



26
27
28
29
30
31
# File 'lib/couchrest/model/designs.rb', line 26

def design(*args, &block)
  mapper = DesignMapper.new(self)
  mapper.create_view_method(:all)

  mapper.instance_eval(&block) if block_given?
end

#paginates_per(val) ⇒ Object

Override the default page pagination value:

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


39
40
41
# File 'lib/couchrest/model/designs.rb', line 39

def paginates_per(val)
  @_default_per_page = val
end