gearheads
/
mastodon
Archived
2
0
Fork 0

Fix Performance/RedundantMerge cop (#24817)

gh/dev
Matt Jankowski 2023-05-03 23:25:43 -04:00 committed by GitHub
parent b25860c509
commit d9a958fcf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 16 deletions

View File

@ -309,12 +309,6 @@ Performance/MapCompact:
- 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb' - 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb'
- 'spec/presenters/status_relationships_presenter_spec.rb' - 'spec/presenters/status_relationships_presenter_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
Exclude:
- 'config/initializers/paperclip.rb'
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SafeMultiline. # Configuration parameters: SafeMultiline.
Performance/StartWith: Performance/StartWith:

View File

@ -68,11 +68,7 @@ if ENV['S3_ENABLED'] == 'true'
} }
) )
if ENV['S3_PERMISSION'] == '' Paperclip::Attachment.default_options[:s3_permissions] = ->(*) { nil } if ENV['S3_PERMISSION'] == ''
Paperclip::Attachment.default_options.merge!(
s3_permissions: ->(*) { nil }
)
end
if ENV.has_key?('S3_ENDPOINT') if ENV.has_key?('S3_ENDPOINT')
Paperclip::Attachment.default_options[:s3_options].merge!( Paperclip::Attachment.default_options[:s3_options].merge!(
@ -90,11 +86,7 @@ if ENV['S3_ENABLED'] == 'true'
) )
end end
if ENV.has_key?('S3_STORAGE_CLASS') Paperclip::Attachment.default_options[:s3_headers]['X-Amz-Storage-Class'] = ENV['S3_STORAGE_CLASS'] if ENV.has_key?('S3_STORAGE_CLASS')
Paperclip::Attachment.default_options[:s3_headers].merge!(
'X-Amz-Storage-Class' => ENV['S3_STORAGE_CLASS']
)
end
# Some S3-compatible providers might not actually be compatible with some APIs # Some S3-compatible providers might not actually be compatible with some APIs
# used by kt-paperclip, see https://github.com/mastodon/mastodon/issues/16822 # used by kt-paperclip, see https://github.com/mastodon/mastodon/issues/16822