mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
new_record stuff to track if something has been persisted to aws
This commit is contained in:
parent
e298e8d788
commit
2ef7546567
2 changed files with 7 additions and 0 deletions
|
@ -16,7 +16,9 @@ module Fog
|
|||
end
|
||||
|
||||
def delete
|
||||
return false if new_record?
|
||||
connection.delete_bucket(name)
|
||||
@new_record = true
|
||||
true
|
||||
end
|
||||
|
||||
|
@ -45,6 +47,7 @@ module Fog
|
|||
options['LocationConstraint'] = @location
|
||||
end
|
||||
connection.put_bucket(name, options)
|
||||
@new_record = false
|
||||
true
|
||||
end
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ module Fog
|
|||
@connection
|
||||
end
|
||||
|
||||
def new_record?
|
||||
!defined?(@new_record) || @new_record
|
||||
end
|
||||
|
||||
def remap_attributes(attributes, mapping)
|
||||
for key, value in mapping
|
||||
if attributes[key]
|
||||
|
|
Loading…
Add table
Reference in a new issue