deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH core 1/5] CIMI: Fixed error when collection used as value for $select (DTACLOUD-432)
Date Mon, 28 Jan 2013 23:48:28 GMT
On Mon, 2013-01-28 at 12:32 +0100, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mfojtik@redhat.com>
> 
> 
> Signed-off-by: Michal fojtik <mfojtik@redhat.com>

ACK, though

> --- a/server/lib/cimi/models/collection.rb
> +++ b/server/lib/cimi/models/collection.rb
> @@ -24,11 +24,15 @@ module CIMI::Model
>      self.schema
>  
>      def initialize(values = {})
> -      if values[:entries]
> -        values[self.class.entry_name] = values.delete(:entries)
> +      if values.kind_of?(Hash) 
> +        if values[:entries]
> +          values[self.class.entry_name] = values.delete(:entries)
> +        end
> +        values[self.class.entry_name] ||= []
> +        super(values)
> +      else
> +        super

This still needs a comment about what besides a Hash can be passed in.

David



Mime
View raw message