before_filter :authorize, :only => [:create, :update, :delete]
before_filter :authorize, :only => [:create, :update, :delete]
before_filter :require_public_data, :only => [:create, :update, :delete]
before_filter :check_api_writable, :only => [:create, :update, :delete]
before_filter :check_api_readable, :except => [:create, :update, :delete]
before_filter :require_public_data, :only => [:create, :update, :delete]
before_filter :check_api_writable, :only => [:create, :update, :delete]
before_filter :check_api_readable, :except => [:create, :update, :delete]
way.create_with_history @user
render :text => way.id.to_s, :content_type => "text/plain"
else
way.create_with_history @user
render :text => way.id.to_s, :content_type => "text/plain"
else
way.update_from(new_way, @user)
render :text => way.version.to_s, :content_type => "text/plain"
else
way.update_from(new_way, @user)
render :text => way.version.to_s, :content_type => "text/plain"
else
way.delete_with_history!(new_way, @user)
render :text => way.version.to_s, :content_type => "text/plain"
else
way.delete_with_history!(new_way, @user)
render :text => way.version.to_s, :content_type => "text/plain"
else
- render :text => doc.to_s, :content_type => "text/xml"
- else
- render :nothing => true, :status => :bad_request
+ doc = OSM::API.new.get_xml_doc
+
+ Way.find(ids).each do |way|
+ doc.root << way.to_xml_node
# :id parameter. note that this used to return deleted ways as well, but
# this seemed not to be the expected behaviour, so it was removed.
def ways_for_node
# :id parameter. note that this used to return deleted ways as well, but
# this seemed not to be the expected behaviour, so it was removed.
def ways_for_node
- wayids = WayNode.find(:all,
- :conditions => ['node_id = ?', params[:id]]
- ).collect { |ws| ws.id[0] }.uniq
+ wayids = WayNode.where(:node_id => params[:id]).collect { |ws| ws.id[0] }.uniq