Skip to content

Commit 0b6252d

Browse files
authored
Merge pull request #600 from cwjenkins/add_uniform
Add uniform attr to inserting file
2 parents f660fbe + 07f5c7c commit 0b6252d

File tree

1 file changed

+7
-2
lines changed
  • lib/fog/storage/google_json/models

1 file changed

+7
-2
lines changed

lib/fog/storage/google_json/models/file.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class File < Fog::Model
55
identity :key, :aliases => ["Key", :name]
66

77
attribute :acl
8+
attribute :uniform
89
attribute :predefined_acl, :aliases => ["predefinedAcl", :predefined_acl]
910
attribute :cache_control, :aliases => ["cacheControl", :cache_control]
1011
attribute :content_disposition, :aliases => ["contentDisposition", :content_disposition]
@@ -37,6 +38,10 @@ class File < Fog::Model
3738
"publicReadWrite"
3839
].freeze
3940

41+
def uniform=(enable)
42+
@uniform=enable
43+
end
44+
4045
def predefined_acl=(new_predefined_acl)
4146
unless VALID_PREDEFINED_ACLS.include?(new_predefined_acl)
4247
raise ArgumentError.new("acl must be one of [#{VALID_PREDEFINED_ACLS.join(', ')}]")
@@ -111,8 +116,8 @@ def save
111116
FILE_INSERTABLE_FIELDS.map { |k| [k, attributes[k]] }
112117
.reject { |pair| pair[1].nil? }
113118
]
114-
115-
options[:predefined_acl] ||= @predefined_acl
119+
120+
options[:predefined_acl] ||= @predefined_acl unless @uniform
116121

117122
service.put_object(directory.key, key, body, **options)
118123
self.content_length = Fog::Storage.get_body_size(body)

0 commit comments

Comments
 (0)