mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
less rushed and actually working fix for s3 owners
This commit is contained in:
parent
4abde5044d
commit
3b055def44
3 changed files with 12 additions and 12 deletions
|
@ -7,7 +7,6 @@ module Fog
|
|||
identity :name, 'Name'
|
||||
|
||||
attribute :creation_date, 'CreationDate'
|
||||
attribute :owner
|
||||
|
||||
def destroy
|
||||
requires :name
|
||||
|
|
|
@ -16,11 +16,7 @@ module Fog
|
|||
data['Buckets'].each do |bucket|
|
||||
buckets << Fog::AWS::S3::Bucket.new({
|
||||
:collection => buckets,
|
||||
:connection => connection,
|
||||
:owner => {
|
||||
:display_name => owner['DisplayName'],
|
||||
:id => owner['ID']
|
||||
}
|
||||
:connection => connection
|
||||
}.merge!(bucket))
|
||||
end
|
||||
buckets
|
||||
|
@ -47,11 +43,7 @@ module Fog
|
|||
bucket.objects << Fog::AWS::S3::Object.new({
|
||||
:bucket => bucket,
|
||||
:connection => connection,
|
||||
:collection => bucket.objects,
|
||||
:owner => {
|
||||
:display_name => owner['DisplayName'],
|
||||
:id => owner['ID']
|
||||
}
|
||||
:collection => bucket.objects
|
||||
}.merge!(object))
|
||||
end
|
||||
bucket
|
||||
|
|
|
@ -11,7 +11,7 @@ module Fog
|
|||
attribute :content_type, 'Content-Type'
|
||||
attribute :etag, ['Etag', 'ETag']
|
||||
attribute :last_modified, ['Last-Modified', 'LastModified']
|
||||
attribute :owner
|
||||
attribute :owner, 'Owner'
|
||||
attribute :size, 'Size'
|
||||
attribute :storage_class, 'StorageClass'
|
||||
|
||||
|
@ -42,6 +42,15 @@ module Fog
|
|||
true
|
||||
end
|
||||
|
||||
def owner=(new_owner)
|
||||
if new_owner
|
||||
@owner = {
|
||||
:display_name => new_owner['DisplayName'],
|
||||
:id => new_owner['ID']
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def save(options = {})
|
||||
requires :body, :bucket, :key
|
||||
data = connection.put_object(bucket.name, @key, @body, options)
|
||||
|
|
Loading…
Add table
Reference in a new issue