Skip to content

Commit

Permalink
Fixed issue with building a collection of complex types
Browse files Browse the repository at this point in the history
  • Loading branch information
visoft committed Jun 16, 2013
1 parent 8842ff1 commit f5b30d8
Show file tree
Hide file tree
Showing 4 changed files with 1,848 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ruby_odata/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,14 @@ def build_batch_operation(operation, changeset_num)

# Complex Types
def complex_type_to_class(complex_type_xml)
klass_name = qualify_class_name(Helpers.get_namespaced_attribute(complex_type_xml, 'type', 'm').split('.')[-1])
type = Helpers.get_namespaced_attribute(complex_type_xml, 'type', 'm')

# Extract the class name in case this is a Collection
if type =~ /\(([^)]*)\)/m
type = $~[1]
end

klass_name = qualify_class_name(type.split('.')[-1])
klass = @classes[klass_name].new

# Fill in the properties
Expand Down
Loading

0 comments on commit f5b30d8

Please sign in to comment.