1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

fixed bug in record.save(). The method now transparently handles saving of new aswell as existing records. All test passing again.

This commit is contained in:
Ijonas Kisselbach 2011-03-10 08:28:57 +08:00 committed by Wesley Beary
parent 8cd9c1ec4b
commit 33744c6da7

View file

@ -36,10 +36,17 @@ module Fog
options = {}
options[:prio] = priority if priority
options[:ttl] = ttl if ttl
options[:name] = name if name
options[:content] = ip if ip
options[:type] = type if type
data = connection.update_record(zone.domain, id, options)
# decide whether its a new record or update of an existing
if id.nil?
data = connection.create_record(zone.domain, name, type, ip, options)
else
options[:name] = name if name
options[:content] = ip if ip
options[:type] = type if type
data = connection.update_record(zone.domain, id, options)
end
merge_attributes(data.body["record"])
true
end