mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Don't use last_modified when loading the body
Port of https://github.com/fog/fog-google/pull/545 where: - last_modified condition was removed - method has been rewritten to be simpler
This commit is contained in:
parent
ab04b45b78
commit
866f0ce3cd
1 changed files with 8 additions and 7 deletions
|
@ -108,15 +108,16 @@ module Fog
|
|||
# @return [File]
|
||||
#
|
||||
def body
|
||||
return attributes[:body] if attributes[:body]
|
||||
return '' unless last_modified
|
||||
return attributes[:body] if attributes.key?(:body)
|
||||
|
||||
file = collection.get(identity)
|
||||
if file
|
||||
attributes[:body] = file.body
|
||||
else
|
||||
attributes[:body] = ''
|
||||
end
|
||||
|
||||
attributes[:body] =
|
||||
if file
|
||||
file.body
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
# Set body attribute.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue