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:
parent
8cd9c1ec4b
commit
33744c6da7
1 changed files with 11 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue