]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/changeset_controller.rb
add support for closing changesets
[rails.git] / app / controllers / changeset_controller.rb
index 3e88eeec32b0425b10ca47c92cc90b057814b8fe..9994a6b1e6c989be5968b0157fe263a0ca500921 100644 (file)
@@ -54,6 +54,21 @@ class ChangesetController < ApplicationController
       render :nothing => true, :status => :not_found
     end
   end
+  
+  def close 
+    begin
+      if not request.put?
+        render :nothing => true, :status => :method_not_allowed
+        return
+      end
+      changeset = Changeset.find(params[:id])
+      changeset.open = false
+      changeset.save
+      render :nothing => true
+    rescue ActiveRecord::RecordNotFound
+      render :nothing => true, :status => :not_found
+    end
+  end
 
   def upload
     if not request.put?