lib/hyper_resource/adapter/hal_json.rb in hyperresource-0.9.3 vs lib/hyper_resource/adapter/hal_json.rb in hyperresource-0.9.4
- old
+ new
@@ -29,10 +29,11 @@
apply_objects(response, resource)
apply_links(response, resource)
apply_attributes(response, resource)
resource.loaded = true
- resource.href = response['_links']['self']['href'] rescue nil
+ new_href = response['_links']['self']['href'] rescue nil
+ resource.href = new_href unless new_href.nil? && resource.href
resource
end
private