On Mon, 2013-02-11 at 13:35 +0100, [email protected] wrote:
> From: Michal Fojtik <[email protected]>
>
>
> Signed-off-by: Michal fojtik <[email protected]>
ACK; one nit:
> 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
> [email protected]
> - - @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