Parcourir la source
Fix follow limit validator reporting lower number past threshold (#9230)
* Fix follow limit validator reporting lower number past threshold
* Avoid floating point follow limit
master
Eugen Rochko
il y a 5 ans
committed by
GitHub
Parent
révision
7f4adfaf77
Aucune clé connue n'a été trouvée dans la base pour cette signature
ID de la clé GPG: 4AEE18F83AFDEB23
1 fichiers modifiés avec
1 ajouts et
1 suppressions
-
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 |
|
|
|