From: Jan Provaznik <[email protected]>
Deltacloud client lib returns 'kind' attribute as a symbol,
but activereord doesn't deal well with it when saving. This
patch stringifies value.
---
src/app/models/hardware_profile.rb | 4 ++--
src/app/models/hardware_profile_property.rb | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/app/models/hardware_profile.rb
b/src/app/models/hardware_profile.rb
index de9ef23..2ce6d81 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -85,10 +85,10 @@ class HardwareProfile < ActiveRecord::Base
def new_property(prop)
return nil unless prop.present?
the_property = HardwareProfileProperty.new(:name => prop.name,
- :kind => prop.kind,
+ :kind => prop.kind.to_s,
:unit => prop.unit,
:value => prop.value)
- case prop.kind
+ case prop.kind.to_s
when HardwareProfileProperty::RANGE
the_property.range_first = prop.range[:from]
the_property.range_last = prop.range[:to]
diff --git a/src/app/models/hardware_profile_property.rb
b/src/app/models/hardware_profile_property.rb
index 0717484..1291122 100644
--- a/src/app/models/hardware_profile_property.rb
+++ b/src/app/models/hardware_profile_property.rb
@@ -26,9 +26,9 @@ class HardwareProfileProperty < ActiveRecord::Base
CPU = "cpu"
ARCHITECTURE = "architecture"
- FIXED = :fixed
- RANGE = :range
- ENUM = :enum
+ FIXED = 'fixed'
+ RANGE = 'range'
+ ENUM = 'enum'
UNIT_MB = "MB"
UNIT_GB = "GB"
--
1.7.0.1
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel