app/models/locomotive/content_type.rb
# Order the list of entries, paginate it if requested
# and filter it.
#
# @param [ Hash ] options Options to filter and paginate.
#
# @return [ Criteria ] A Mongoid criteria if not paginated (array otherwise).
#
Order the list of entries, paginate it if requested
and filter it.
Order the list of entries paginate it if requested and filter it .
def ordered_entries(options = nil)
      options ||= {}
      page, per_page = options.delete(:page), options.delete(:per_page)
      if options[:q]
        options[label_field_name.to_sym] = /#{options.delete(:q)}/i
      end
      _order_by_definition = (options || {}).delete(:order_by).try(:split) || self.order_by_definition
      _entries = self.entries.order_by([_order_by_definition]).where(options)
      !self.order_manually? && page ? _entries.page(page).per(per_page) : _entries
    end
def ordered_entries ( options = nil ) options ||= { } page , per_page = options . delete ( :page ) , options . delete ( :per_page ) if options [ :q ] options [ label_field_name . to_sym ] = / #{ options . delete ( :q ) } /i end _order_by_definition = ( options || { } ) . delete ( :order_by ) . try ( :split ) || self . order_by_definition _entries = self . entries . order_by ( [ _order_by_definition ] ) . where ( options ) ! self . order_manually? && page ? _entries . page ( page ) . per ( per_page ) : _entries end
Order the list of entries, paginate it if requested
and filter it.
Order the list of entries paginate it if requested and filter it .
# search for a label # order list # get list # pagination or full list
A Mongoid criteria if not paginated (array otherwise).
A Mongoid criteria if not paginated ( array otherwise ) .
 Criteria 
options
<not_specific>
<not_specific>
options Options to filter and paginate.
options Options to filter and paginate .