Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

model hacking working towards passing tests

  • Loading branch information...
commit 7a9d709398f09f57a2d5dca29b3924c017ab5aec 1 parent 37af71d
@dje dje authored
View
7 lib/fog/dns/models/dnsimple/record.rb
@@ -23,8 +23,7 @@ def initialize(attributes={})
end
def destroy
- requires :identity
- connection.delete_record(identity)
+ connection.delete_record(zone.domain, identity)
true
end
@@ -37,8 +36,8 @@ def save
options = {}
options[:prio] = priority if priority
options[:ttl] = ttl if ttl
- connection.create_record(zone.id, name, type, ip, options)
- merge_attributes(data.body)
+ data = connection.create_record(zone.domain, name, type, ip, options)
+ merge_attributes(data.body["record"])
true
end
View
6 lib/fog/dns/models/dnsimple/zone.rb
@@ -7,9 +7,9 @@ class DNS
class Zone < Fog::Model
- identity :id
+ identity :id, :aliases => "name"
- attribute :domain, :aliases => "name"
+ attribute :domain, :aliases => "name"
attribute :created_at
attribute :updated_at
@@ -39,7 +39,7 @@ def nameservers
def save
requires :domain
- data = connection.create_domain(domain).body
+ data = connection.create_domain(domain).body["domain"]
true
end
Please sign in to comment.
Something went wrong with that request. Please try again.