Permalink
Browse files

model hacking working towards passing tests

  • Loading branch information...
1 parent 37af71d commit 7a9d709398f09f57a2d5dca29b3924c017ab5aec @dje dje committed Feb 25, 2011
Showing with 6 additions and 7 deletions.
  1. +3 −4 lib/fog/dns/models/dnsimple/record.rb
  2. +3 −3 lib/fog/dns/models/dnsimple/zone.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
@@ -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

0 comments on commit 7a9d709

Please sign in to comment.