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?
# API
map.connect "api/#{API_VERSION}/changeset/create", :controller => 'changeset', :action => 'create'
map.connect "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'read'
+ map.connect "api/#{API_VERSION}/changeset/:id/close", :controller => 'changeset', :action => 'close'
map.connect "api/#{API_VERSION}/changeset/upload", :controller => 'changeset', :action => 'upload'
map.connect "api/#{API_VERSION}/node/create", :controller => 'node', :action => 'create'