about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-11-08 21:06:01 +0100
committerGitHub <noreply@github.com>2018-11-08 21:06:01 +0100
commit7f4adfaf779635035db568095f684a2ded4aea6b (patch)
treec1d42729ba0e07e155b48183465f03555441fb27 /app
parent6d59dfa15d873da75c731b79367ab6b3d1b2f5a5 (diff)
Fix follow limit validator reporting lower number past threshold (#9230)
* Fix follow limit validator reporting lower number past threshold

* Avoid floating point follow limit
Diffstat (limited to 'app')
-rw-r--r--app/validators/follow_limit_validator.rb2
1 files changed, 1 insertions, 1 deletions
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