From 32c2f5a07f8c69da75d3b4643e9c0d07525ce0de Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 8 Nov 2018 21:06:01 +0100 Subject: [PATCH] Fix follow limit validator reporting lower number past threshold (#9230) * Fix follow limit validator reporting lower number past threshold * Avoid floating point follow limit --- app/validators/follow_limit_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validators/follow_limit_validator.rb b/app/validators/follow_limit_validator.rb index eb083ed854..409bf01763 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