Quellcode durchsuchen
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
vor 5 Jahren
committed by
GitHub
Ursprung
Commit
7f4adfaf77
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
1 geänderte Dateien mit
1 neuen und
1 gelöschten Zeilen
-
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 |
|
|
|