mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Raise an exception if #total_count is called on a non-count paginable scope
This commit is contained in:
parent
5ef7911c4e
commit
1f33aacd0b
1 changed files with 6 additions and 0 deletions
|
@ -78,5 +78,11 @@ module Kaminari
|
||||||
load unless loaded?
|
load unless loaded?
|
||||||
@records.empty?
|
@records.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Force to raise an exception if #total_count is called explicitly.
|
||||||
|
def total_count
|
||||||
|
raise "This scope is marked as a non-count paginable scope and can't be used in combination " \
|
||||||
|
"with `#paginate' or `#page_entries_info'. Use #link_to_next_page or #link_to_previous_page instead."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue