You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/11/16 14:10:09 UTC
[PATCH core] CIMI: Added .singularize method to CIMI_element_name
From: Michal Fojtik <mf...@redhat.com>
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/lib/cimi/model/schema.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/lib/cimi/model/schema.rb b/server/lib/cimi/model/schema.rb
index 4bed002..9e010d3 100644
--- a/server/lib/cimi/model/schema.rb
+++ b/server/lib/cimi/model/schema.rb
@@ -132,11 +132,11 @@ class CIMI::Model::Schema
private
def struct
- cname = "CIMI_#{json_name.upcase_first}"
+ cname = "CIMI_#{json_name.upcase_first.singularize}"
if ::Struct.const_defined?(cname)
::Struct.const_get(cname)
else
- ::Struct.new("CIMI_#{json_name.upcase_first}",
+ ::Struct.new("CIMI_#{json_name.upcase_first.singularize}",
*@schema.attribute_names)
end
end
--
1.7.4.4