mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Splat options
This commit is contained in:
parent
2f15938587
commit
94a450acbe
1 changed files with 2 additions and 16 deletions
|
@ -4,22 +4,8 @@ require "active_support/core_ext/numeric/bytes"
|
||||||
class ActiveStorage::Service::S3Service < ActiveStorage::Service
|
class ActiveStorage::Service::S3Service < ActiveStorage::Service
|
||||||
attr_reader :client, :bucket
|
attr_reader :client, :bucket
|
||||||
|
|
||||||
def initialize(access_key_id:, secret_access_key:, region:, bucket:, endpoint: nil)
|
def initialize(access_key_id:, secret_access_key:, region:, bucket:, **options)
|
||||||
@client = if endpoint
|
@client = Aws::S3::Resource.new(access_key_id: access_key_id, secret_access_key: secret_access_key, region: region, **options)
|
||||||
Aws::S3::Resource.new(
|
|
||||||
access_key_id: access_key_id,
|
|
||||||
secret_access_key: secret_access_key,
|
|
||||||
region: region,
|
|
||||||
endpoint: endpoint
|
|
||||||
)
|
|
||||||
else
|
|
||||||
Aws::S3::Resource.new(
|
|
||||||
access_key_id: access_key_id,
|
|
||||||
secret_access_key: secret_access_key,
|
|
||||||
region: region
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
@bucket = @client.bucket(bucket)
|
@bucket = @client.bucket(bucket)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue