X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6d44c78407ea9a553be030f3f7c49b48d616878b..06a3213acdaab8d321ecbc4f1af47b9907bb5649:/app/controllers/relation_controller.rb?ds=sidebyside diff --git a/app/controllers/relation_controller.rb b/app/controllers/relation_controller.rb index efd5bf9dc..d00e9e077 100644 --- a/app/controllers/relation_controller.rb +++ b/app/controllers/relation_controller.rb @@ -15,12 +15,9 @@ class RelationController < ApplicationController render :nothing => true, :status => :precondition_failed else relation.user_id = @user.id + relation.save_with_history! - if relation.save_with_history - render :text => relation.id.to_s, :content_type => "text/plain" - else - render :text => "save error", :status => :internal_server_error - end + render :text => relation.id.to_s, :content_type => "text/plain" end else render :nothing => true, :status => :bad_request @@ -61,12 +58,9 @@ class RelationController < ApplicationController relation.tags = new_relation.tags relation.members = new_relation.members relation.visible = true + relation.save_with_history! - if relation.save_with_history - render :nothing => true - else - render :nothing => true, :status => :internal_server_error - end + render :nothing => true end else render :nothing => true, :status => :bad_request @@ -94,12 +88,9 @@ class RelationController < ApplicationController relation.tags = [] relation.members = [] relation.visible = false + relation.save_with_history! - if relation.save_with_history - render :nothing => true - else - render :nothing => true, :status => :internal_server_error - end + render :nothing => true end else render :nothing => true, :status => :gone