deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH core 08/11] Core: Fixed JSON and XML serialization of realms
Date Fri, 22 Feb 2013 10:30:25 GMT
On 02/21, David Lutterkort wrote:
> On Mon, 2013-02-11 at 13:35 +0100, mfojtik@redhat.com wrote:
> > From: Michal Fojtik <mfojtik@redhat.com>
> > 
> > 
> > Signed-off-by: Michal fojtik <mfojtik@redhat.com>
> 
> ACK; one nit:

Thanks! Fixed all two :-)

> 
> > diff --git a/server/lib/deltacloud/models/realm.rb b/server/lib/deltacloud/models/realm.rb
> > index 1c25ba2..7f1e2e9 100644
> > --- a/server/lib/deltacloud/models/realm.rb
> > +++ b/server/lib/deltacloud/models/realm.rb
> > @@ -30,7 +30,7 @@ class Realm < BaseModel
> >        :state => state,
> >        :limit => limit
> >      }
> > -    r.merge!({:resource_types => resource_types}) if resource_types
> > +    r.merge!({:resource_types => resource_types || []})
> 
> This should just be 'r[:resource_types] = resource_types || []' ?
> 
> > diff --git a/server/views/realms/show.xml.haml b/server/views/realms/show.xml.haml
> > index 268cb65..f584c43 100644
> > --- a/server/views/realms/show.xml.haml
> > +++ b/server/views/realms/show.xml.haml
> > @@ -9,6 +9,7 @@
> >      %limit<
> >        =cdata do
> >          =@realm.limit
> > -  - @realm.resource_types.each do |r|
> > -    %resource_type<
> > -      =r
> > +  - if @realm.resource_types
> > +    - @realm.resource_types.each do |r|
> > +      %resource_type<
> > +        =r
> 
> Is this really needed ? You just fixed up Realm to always have an array
> in resource_types ...
> 
> David
> 
> 

-- 
Michal Fojtik <mfojtik@redhat.com>
Deltacloud API, CloudForms

Mime
View raw message