From: Tomas Sedovic <tsedovic(a)redhat.com>
When an instance was being launched, there was a problem when its hardware
profile contained `nil` value for the `enum` type.
`nil` in that context means "match anything", so that's what it does now.
---
src/app/models/hardware_profile.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index 57d5fd8..b6570a9 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -178,7 +178,7 @@ class HardwareProfile < ActiveRecord::Base
return front_end_property.value
when "enum"
create_array_from_property(back_end_property).sort!.each do |value|
- if BigDecimal.new(value) >= BigDecimal.new(front_end_property.value)
+ if front_end_property.value.nil? or BigDecimal.new(value) >=
BigDecimal.new(front_end_property.value)
return value
end
end
--
1.7.6