From: Eugen Rochko Date: Thu, 8 Nov 2018 20:06:01 +0000 (+0100) Subject: Fix follow limit validator reporting lower number past threshold (#9230) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=7f4adfaf779635035db568095f684a2ded4aea6b;p=mastodon.git Fix follow limit validator reporting lower number past threshold (#9230) * Fix follow limit validator reporting lower number past threshold * Avoid floating point follow limit --- diff --git a/app/validators/follow_limit_validator.rb b/app/validators/follow_limit_validator.rb index eb083ed85..409bf0176 100644 --- a/app/validators/follow_limit_validator.rb +++ b/app/validators/follow_limit_validator.rb @@ -14,7 +14,7 @@ class FollowLimitValidator < ActiveModel::Validator if account.following_count < LIMIT LIMIT else - account.followers_count * RATIO + [(account.followers_count * RATIO).round, LIMIT].max end end end