From 8c5db7cabaa827bf9510df7838ce14380bdbb521 Mon Sep 17 00:00:00 2001 From: albert Date: Sat, 7 Jan 2012 21:35:26 -0500 Subject: [PATCH] fix for negative post counts --- app/models/tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index 4d5149b76..3803d19e3 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -334,7 +334,7 @@ class Tag < ActiveRecord::Base end def related_cache_expiry - base = Math.sqrt(post_count) + base = Math.sqrt([post_count, 0].max) if base > 24 24 else