From 2d39404b66b27b0f4c29606c8416de3d1fd15565 Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 12 Mar 2013 12:39:16 -0400 Subject: [PATCH] reduce tag sub post limit --- app/models/tag_subscription.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/tag_subscription.rb b/app/models/tag_subscription.rb index 420d921db..8ce83c081 100644 --- a/app/models/tag_subscription.rb +++ b/app/models/tag_subscription.rb @@ -43,8 +43,9 @@ class TagSubscription < ActiveRecord::Base end def process + divisor = [tag_query_array.size / 2, 1].max post_ids = tag_query_array.inject([]) do |all, tag| - all += Post.tag_match(tag).limit(Danbooru.config.tag_subscription_post_limit / 3).select("posts.id").order("posts.id DESC").map(&:id) + all += Post.tag_match(tag).limit(Danbooru.config.tag_subscription_post_limit / divisor).select("posts.id").order("posts.id DESC").map(&:id) end self.post_ids = post_ids.sort.reverse.slice(0, Danbooru.config.tag_subscription_post_limit).join(",") end