new_record stuff to track if something has been persisted to aws

This commit is contained in:
Wesley Beary 2009-08-04 19:44:04 -07:00
parent e298e8d788
commit 2ef7546567
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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]