浏览代码
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
5 年前
committed by
GitHub
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有
1 个文件被更改,包括
1 次插入 和
1 次删除
-
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 |
|
|
|