lib/relaxdb/relaxdb.rb
#
# Paginates over views that don't emit the underlying doc as a val
# using the same idiom as qpaginate_view
#
Paginates over views that don't emit the underlying doc as a val
using the same idiom as qpaginate_view
Paginates over views that don ' t emit the underlying doc as a val using the same idiom as qpaginate_view
def qpaginate_docs view_name, atts
      page_params = atts.delete :page_params
      view_keys = atts.delete :attributes      
      paginate_params = PaginateParams.new atts
      raise paginate_params.error_msg if paginate_params.invalid?       
      paginator = Paginator.new(paginate_params, page_params)
      atts[:raw] = true
      query = Query.new(view_name, atts)
      query.merge(paginate_params)
      result = JSON.parse(db.get(query.view_path).body)
      doc_ids = ids_from_view result
      doc_ids.reverse! if paginate_params.order_inverted?
      docs = RelaxDB.load! doc_ids
      paginator.add_q_next_and_prev docs, view_name, view_keys
      docs      
    end
def qpaginate_docs view_name , atts page_params = atts . delete :page_params view_keys = atts . delete :attributes paginate_params = PaginateParams . new atts raise paginate_params . error_msg if paginate_params . invalid? paginator = Paginator . new ( paginate_params , page_params ) atts [ :raw ] = true query = Query . new ( view_name , atts ) query . merge ( paginate_params ) result = JSON . parse ( db . get ( query . view_path ) . body ) doc_ids = ids_from_view result doc_ids . reverse! if paginate_params . order_inverted? docs = RelaxDB . load! doc_ids paginator . add_q_next_and_prev docs , view_name , view_keys docs end
Paginates over views that don't emit the underlying doc as a val
using the same idiom as qpaginate_view
Paginates over views that don ' t emit the underlying doc as a val using the same idiom as qpaginate_view
view_name
<not_specific>
atts
<not_specific>