소스 검색
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
No known key found for this signature in database
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 |
|
|
|