1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

fixing up final model bits

This commit is contained in:
Darrin Eden 2011-02-24 21:13:16 -08:00
parent 7a9d709398
commit b7ee5ae185
3 changed files with 6 additions and 8 deletions

View file

@ -7,14 +7,13 @@ module Fog
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 @@ module Fog
def save
requires :domain
data = connection.create_domain(domain).body["domain"]
merge_attributes(data)
true
end

View file

@ -16,10 +16,8 @@ module Fog
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

View file

@ -26,8 +26,8 @@ module Fog
def get_domain(id)
request(
:expects => 200,
:method => 'GET',
:path => '/domains/#{id}'
:method => "GET",
:path => "/domains/#{id}"
)
end