Correctly record which user deleted an object.
This commit is contained in:
parent
bb4b682d0b
commit
0c198107af
3 changed files with 3 additions and 0 deletions
|
@ -58,6 +58,7 @@ class NodeController < ApplicationController
|
|||
if Segment.find(:first, :conditions => [ "visible = 1 and (node_a = ? or node_b = ?)", node.id, node.id])
|
||||
render :nothing => true, :status => HTTP_PRECONDITION_FAILED
|
||||
else
|
||||
node.user_id = @user.id
|
||||
node.visible = 0
|
||||
node.save_with_history
|
||||
render :nothing => true
|
||||
|
|
|
@ -60,6 +60,7 @@ class SegmentController < ApplicationController
|
|||
if WaySegment.find(:first, :joins => "INNER JOIN current_ways ON current_ways.id = current_way_segments.id", :conditions => [ "current_ways.visible = 1 AND current_way_segments.segment_id = ?", segment.id ])
|
||||
render :nothing => true, :status => HTTP_PRECONDITION_FAILED
|
||||
else
|
||||
segment.user_id = @user.id
|
||||
segment.visible = 0
|
||||
segment.save_with_history
|
||||
render :nothing => true
|
||||
|
|
|
@ -87,6 +87,7 @@ class WayController < ApplicationController
|
|||
|
||||
when :delete
|
||||
if way.visible
|
||||
way.user_id = @user.id
|
||||
way.visible = false
|
||||
way.save_with_history
|
||||
render :nothing => true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue