Permalink
Browse files

fixing up final model bits

  • Loading branch information...
dje committed Feb 25, 2011
1 parent 7a9d709 commit b7ee5ae185807a3b3101a72d075556dc5cf22368
@@ -7,14 +7,13 @@ class DNS
class Zone < Fog::Model
- identity :id, :aliases => "name"
+ identity :id
attribute :domain, :aliases => "name"
attribute :created_at
attribute :updated_at
def destroy
- requires :identity
connection.delete_domain(identity)
true
end
@@ -40,6 +39,7 @@ def nameservers
def save
requires :domain
data = connection.create_domain(domain).body["domain"]
+ merge_attributes(data)
true
end
@@ -16,10 +16,8 @@ def all
def get(zone_id)
data = connection.get_domain(zone_id).body["domain"]
- zone = new(data)
- zone.records.load(data["record"])
- zone
- rescue Fog::Service::NotFound
+ new(data)
+ rescue Excon::Errors::NotFound
nil
end
@@ -26,8 +26,8 @@ class Real
def get_domain(id)
request(
:expects => 200,
- :method => 'GET',
- :path => '/domains/#{id}'
+ :method => "GET",
+ :path => "/domains/#{id}"
)
end

0 comments on commit b7ee5ae

Please sign in to comment.