class NodeController < ApplicationController
require 'xml/libxml'
- before_filter :authorize, :only => [:create, :update, :destroy]
+ before_filter :authorize, :only => [:create, :update, :delete]
after_filter :compress_output
def create
new_node = Node.from_xml(request.raw_post)
if new_node and new_node.id == node.id
- node.timestamp = Time.now
node.user_id = @user.id
-
node.latitude = new_node.latitude
node.longitude = new_node.longitude
node.tags = new_node.tags
class SegmentController < ApplicationController
require 'xml/libxml'
- before_filter :authorize, :only => [:create, :update, :destroy]
+ before_filter :authorize, :only => [:create, :update, :delete]
after_filter :compress_output
def create
elsif !new_segment.preconditions_ok?
render :nothing => true, :status => :precondition_failed
else
- segment.timestamp = Time.now
segment.user_id = @user.id
segment.node_a = new_segment.node_a
segment.node_b = new_segment.node_b
class WayController < ApplicationController
require 'xml/libxml'
- before_filter :authorize, :only => [:create, :update, :destroy]
+ before_filter :authorize, :only => [:create, :update, :delete]
after_filter :compress_output
def create
way.user_id = @user.id
way.tags = new_way.tags
way.segs = new_way.segs
- way.timestamp = new_way.timestamp
way.visible = true
if way.save_with_history
if way.visible
way.user_id = @user.id
+ way.tags = []
+ way.segs = []
way.visible = false
if way.save_with_history