fix fast_count
This commit is contained in:
@@ -602,7 +602,7 @@ class Post < ActiveRecord::Base
|
||||
count = get_count_from_cache(tags)
|
||||
|
||||
if count.nil?
|
||||
fast_count_search(tags)
|
||||
count = fast_count_search(tags)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -623,6 +623,8 @@ class Post < ActiveRecord::Base
|
||||
if count > Danbooru.config.posts_per_page * 10
|
||||
set_count_in_cache(tags, count)
|
||||
end
|
||||
|
||||
count
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ module Danbooru
|
||||
|
||||
# taken from kaminari (https://github.com/amatsuda/kaminari)
|
||||
def total_count
|
||||
raise if @paginator_options[:count] == 0
|
||||
return @paginator_options[:count] if @paginator_options[:count]
|
||||
|
||||
c = except(:offset, :limit, :order)
|
||||
|
||||
Reference in New Issue
Block a user