diff --git a/app/logical/pagination_extension.rb b/app/logical/pagination_extension.rb index a4d367be4..27963ac5b 100644 --- a/app/logical/pagination_extension.rb +++ b/app/logical/pagination_extension.rb @@ -104,7 +104,7 @@ module PaginationExtension # taken from kaminari (https://github.com/amatsuda/kaminari) def total_count - @paginator_count ||= except(:offset, :limit, :order).reorder(nil).count + @paginator_count ||= unscoped.from(except(:offset, :limit, :order).reorder(nil)).count rescue ActiveRecord::StatementInvalid => e if e.to_s =~ /statement timeout/ 1_000_000 diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 9eaafc6f2..f0abf5cee 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -5,11 +5,11 @@ - <% if (@current_item.try(:prev_page) rescue false) %> + <% if @current_item.try(:prev_page) %> <%= tag.link rel: "prev", href: url_for(nav_params_for(@current_item.prev_page)) %> <% end %> - <% if (@current_item.try(:next_page) rescue false) %> + <% if @current_item.try(:next_page) %> <%= tag.link rel: "next", href: url_for(nav_params_for(@current_item.next_page)) %> <% end %>