Skip to content

Commit

Permalink
model hacking working towards passing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dje committed Feb 25, 2011
1 parent 37af71d commit 7a9d709
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/fog/dns/models/dnsimple/record.rb
Expand Up @@ -23,8 +23,7 @@ def initialize(attributes={})
end end


def destroy def destroy
requires :identity connection.delete_record(zone.domain, identity)
connection.delete_record(identity)
true true
end end


Expand All @@ -37,8 +36,8 @@ def save
options = {} options = {}
options[:prio] = priority if priority options[:prio] = priority if priority
options[:ttl] = ttl if ttl options[:ttl] = ttl if ttl
connection.create_record(zone.id, name, type, ip, options) data = connection.create_record(zone.domain, name, type, ip, options)
merge_attributes(data.body) merge_attributes(data.body["record"])
true true
end end


Expand Down
6 changes: 3 additions & 3 deletions lib/fog/dns/models/dnsimple/zone.rb
Expand Up @@ -7,9 +7,9 @@ class DNS


class Zone < Fog::Model class Zone < Fog::Model


identity :id identity :id, :aliases => "name"


attribute :domain, :aliases => "name" attribute :domain, :aliases => "name"
attribute :created_at attribute :created_at
attribute :updated_at attribute :updated_at


Expand Down Expand Up @@ -39,7 +39,7 @@ def nameservers


def save def save
requires :domain requires :domain
data = connection.create_domain(domain).body data = connection.create_domain(domain).body["domain"]
true true
end end


Expand Down

0 comments on commit 7a9d709

Please sign in to comment.