Module: Card::Set::Abstract::Paging::PagingViews::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod002-collection/abstract/paging/paging_views.rb

Instance Method Summary collapse

Instance Method Details

#fewer_results_than_limit?Boolean

clear we don’t need paging even before running count query

Returns:

  • (Boolean)
[View source]

18
19
20
21
22
# File 'platypus/tmp/set/gem-defaults/mod002-collection/abstract/paging/paging_views.rb', line 18

def fewer_results_than_limit?
  return false unless offset.zero?

  limit > offset + search_with_params.length
end

#show_paging?Boolean

Returns:

  • (Boolean)
[View source]

9
10
11
12
13
14
15
# File 'platypus/tmp/set/gem-defaults/mod002-collection/abstract/paging/paging_views.rb', line 9

def show_paging?
  return false if limit < 1
  return false if fewer_results_than_limit? # avoid extra count search

  # count search result instead
  limit < count_with_params
end