Fix misc rubocop warnings.

This commit is contained in:
evazion
2020-06-16 21:36:15 -05:00
parent dc460aab53
commit b551e3634f
25 changed files with 75 additions and 95 deletions

View File

@@ -7,10 +7,11 @@ class SpamDetector
# if a person receives more than 10 automatic spam reports within a 1 hour
# window, automatically ban them forever.
AUTOBAN_THRESHOLD = 10
AUTOBAN_WINDOW = 1.hours
AUTOBAN_DURATION = 999999
AUTOBAN_WINDOW = 1.hour
AUTOBAN_DURATION = 999_999
attr_accessor :record, :user, :user_ip, :content, :comment_type
rakismet_attrs author: proc { user.name },
author_email: proc { user.email_address&.address },
blog_lang: "en",
@@ -84,8 +85,8 @@ class SpamDetector
end
is_spam
rescue StandardError => exception
DanbooruLogger.log(exception)
rescue StandardError => e
DanbooruLogger.log(e)
false
end
end