DEV: Fix Lint/BooleanSymbol (#24747)

This commit is contained in:
Jarek Radosz
2023-12-06 13:19:09 +01:00
committed by GitHub
parent 138bf486d3
commit 6a66dc1cfb
9 changed files with 13 additions and 7 deletions

View File

@ -85,6 +85,7 @@ module Middleware
CrawlerDetection.is_blocked_crawler?(@env[USER_AGENT])
end
# rubocop:disable Lint/BooleanSymbol
def is_mobile=(val)
@is_mobile = val ? :true : :false
end
@ -111,6 +112,7 @@ module Middleware
end
@has_brotli == :true
end
# rubocop:enable Lint/BooleanSymbol
def key_locale
if locale = Discourse.anonymous_locale(@request)
@ -120,6 +122,7 @@ module Middleware
end
end
# rubocop:disable Lint/BooleanSymbol
def is_crawler?
@is_crawler ||=
begin
@ -140,6 +143,7 @@ module Middleware
@is_crawler == :true
end
alias_method :key_is_crawler?, :is_crawler?
# rubocop:enable Lint/BooleanSymbol
def key_is_modern_mobile_device?
MobileDetection.modern_mobile_device?(@env[USER_AGENT]) if @env[USER_AGENT]