Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Fixed issue where nested entities were being duplicated on the parent…
Browse files Browse the repository at this point in the history
… save when the child was saved.
  • Loading branch information
visoft committed Jun 5, 2010
1 parent 45a77a4 commit 9dfb762
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/odata_ruby/class_builder.rb
Expand Up @@ -49,7 +49,7 @@ def add_methods(klass)
meta = '__metadata'
vars = self.instance_values

if !options.nil? && options[:type] == :add && vars.has_key?(meta)
if !options.nil? && !options[:seen].nil? && vars.has_key?(meta)
vars.delete_if { |k,v| k != meta}
else
vars.delete(meta)
Expand Down
2 changes: 1 addition & 1 deletion lib/odata_ruby/service.rb
Expand Up @@ -58,7 +58,7 @@ def save_changes

if @save_operation.kind == "Add"
save_uri = "#{@uri}/#{@save_operation.klass_name}"
json_klass = @save_operation.klass.to_json(:type => :add)
json_klass = @save_operation.klass.to_json
post_result = RestClient.post save_uri, json_klass, :content_type => :json
result = build_classes_from_result(post_result)
elsif @save_operation.kind == "Update"
Expand Down

0 comments on commit 9dfb762

Please sign in to comment.