]> git.openstreetmap.org Git - rails.git/commitdiff
Correctly record which user deleted an object.
authorTom Hughes <tom@compton.nu>
Fri, 22 Jun 2007 15:37:57 +0000 (15:37 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 22 Jun 2007 15:37:57 +0000 (15:37 +0000)
app/controllers/node_controller.rb
app/controllers/segment_controller.rb
app/controllers/way_controller.rb

index f2a3ce3291cd48e2f7203d5457eb742fbb150a4e..6815470b8f19771599266e906b6e0da1fd88fcf5 100644 (file)
@@ -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
index 5ef11084cb795809fd3eb834a8c57fdac5d1d2b2..bc41b85a39a116a02dadebb660a344242603f0ba 100644 (file)
@@ -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
index e7eead52fe770d223e3a5cb1cc795db0745d6871..dca9241a698e490ba2d497bddbff54a5f880d237 100644 (file)
@@ -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