mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +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
@ -31,13 +31,13 @@ module FileStore
|
||||
end
|
||||
|
||||
def self.s3_options_from_env
|
||||
unless ENV["DISCOURSE_S3_BUCKET"].present? && ENV["DISCOURSE_S3_REGION"].present? &&
|
||||
(
|
||||
(
|
||||
ENV["DISCOURSE_S3_ACCESS_KEY_ID"].present? &&
|
||||
ENV["DISCOURSE_S3_SECRET_ACCESS_KEY"].present?
|
||||
) || ENV["DISCOURSE_S3_USE_IAM_PROFILE"].present?
|
||||
)
|
||||
if ENV["DISCOURSE_S3_BUCKET"].blank? || ENV["DISCOURSE_S3_REGION"].blank? ||
|
||||
!(
|
||||
(
|
||||
ENV["DISCOURSE_S3_ACCESS_KEY_ID"].present? &&
|
||||
ENV["DISCOURSE_S3_SECRET_ACCESS_KEY"].present?
|
||||
) || ENV["DISCOURSE_S3_USE_IAM_PROFILE"].present?
|
||||
)
|
||||
raise ToS3MigrationError.new(<<~TEXT)
|
||||
Please provide the following environment variables:
|
||||
- DISCOURSE_S3_BUCKET
|
||||
|
Reference in New Issue
Block a user