mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Enable unless
cops
We discussed the use of `unless` internally and decided to enforce available rules from rubocop to restrict its most problematic uses.
This commit is contained in:

committed by
Loïc Guitaut

parent
87de3c2319
commit
f7c57fbc19
@ -243,7 +243,7 @@ module SiteSettings::Validations
|
||||
|
||||
def validate_cors_origins(new_val)
|
||||
return if new_val.blank?
|
||||
return unless new_val.split("|").any?(%r{/\z})
|
||||
return if new_val.split("|").none?(%r{/\z})
|
||||
validate_error :cors_origins_should_not_have_trailing_slash
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user