From b461fb05ba18862d9f8248620cb9577fb3e1d272 Mon Sep 17 00:00:00 2001 From: geemus Date: Thu, 10 Mar 2011 12:24:41 -0800 Subject: [PATCH] [dns|dnsimple] use load for collection #all --- lib/fog/dns/models/dnsimple/records.rb | 4 ++-- lib/fog/dns/models/dnsimple/zones.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/fog/dns/models/dnsimple/records.rb b/lib/fog/dns/models/dnsimple/records.rb index 132fa6a90..3caf1f67c 100644 --- a/lib/fog/dns/models/dnsimple/records.rb +++ b/lib/fog/dns/models/dnsimple/records.rb @@ -14,8 +14,8 @@ module Fog def all requires :zone clear - data = connection.list_records(zone.id).body - data.each {|object| self << new(object["record"]) } + data = connection.list_records(zone.id).body.map {|record| record['record']} + load(data) end def get(record_id) diff --git a/lib/fog/dns/models/dnsimple/zones.rb b/lib/fog/dns/models/dnsimple/zones.rb index 9dc9d5000..77c5241f5 100644 --- a/lib/fog/dns/models/dnsimple/zones.rb +++ b/lib/fog/dns/models/dnsimple/zones.rb @@ -11,8 +11,8 @@ module Fog def all clear - data = connection.list_domains.body - data.each {|object| self << new(object["domain"]) } + data = connection.list_domains.body.map {|zone| zone['domain']} + load(data) end def get(zone_id)