- if request.put?
- relation = Relation.from_xml(request.raw_post, true)
-
- if relation
- if !relation.preconditions_ok?
- render :text => "", :status => :precondition_failed
- else
- relation.version = 0
- relation.user_id = @user.id
- relation.save_with_history!
-
- render :text => relation.id.to_s, :content_type => "text/plain"
- end
+ begin
+ if request.put?
+ relation = Relation.from_xml(request.raw_post, true)
+
+ # We assume that an exception has been thrown if there was an error
+ # generating the relation
+ #if relation
+ relation.create_with_history @user
+ render :text => relation.id.to_s, :content_type => "text/plain"
+ #else
+ # render :text => "Couldn't get turn the input into a relation.", :status => :bad_request
+ #end