fix tests
This commit is contained in:
@@ -1034,17 +1034,19 @@ class Post < ActiveRecord::Base
|
||||
|
||||
# optimize some cases. these are just estimates but at these
|
||||
# quantities being off by a few hundred doesn't matter much
|
||||
if tags == ""
|
||||
return (Post.maximum(:id) * (2200402.0 / 2232212)).floor
|
||||
if Danbooru.config.estimate_post_counts
|
||||
if tags == ""
|
||||
return (Post.maximum(:id) * (2200402.0 / 2232212)).floor
|
||||
|
||||
elsif tags =~ /^rating:s(?:afe)?$/
|
||||
return (Post.maximum(:id) * (1648652.0 / 2200402)).floor
|
||||
elsif tags =~ /^rating:s(?:afe)?$/
|
||||
return (Post.maximum(:id) * (1648652.0 / 2200402)).floor
|
||||
|
||||
elsif tags =~ /^rating:q(?:uestionable)?$/
|
||||
return (Post.maximum(:id) * (350101.0 / 2200402)).floor
|
||||
elsif tags =~ /^rating:q(?:uestionable)?$/
|
||||
return (Post.maximum(:id) * (350101.0 / 2200402)).floor
|
||||
|
||||
elsif tags =~ /^rating:e(?:xplicit)?$/
|
||||
return (Post.maximum(:id) * (201650.0 / 2200402)).floor
|
||||
elsif tags =~ /^rating:e(?:xplicit)?$/
|
||||
return (Post.maximum(:id) * (201650.0 / 2200402)).floor
|
||||
end
|
||||
end
|
||||
|
||||
count = get_count_from_cache(tags)
|
||||
|
||||
Reference in New Issue
Block a user