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]
relation.update_from new_relation, @user
render :text => relation.version.to_s, :content_type => "text/plain"
else
relation.update_from new_relation, @user
render :text => relation.version.to_s, :content_type => "text/plain"
else
relation.delete_with_history!(new_relation, @user)
render :text => relation.version.to_s, :content_type => "text/plain"
else
relation.delete_with_history!(new_relation, @user)
render :text => relation.version.to_s, :content_type => "text/plain"
else
- relations = Relation.find(relation_ids, :include => [:relation_tags])
- ways = Way.find(way_ids, :include => [:way_nodes, :way_tags])
+ relations = Relation.where(:id => relation_ids).includes(:relation_tags)
+ ways = Way.where(:id => way_ids).includes(:way_nodes, :way_tags)
# now additionally collect nodes referenced by ways. Note how we
# recursively evaluate ways but NOT relations.
# now additionally collect nodes referenced by ways. Note how we
# recursively evaluate ways but NOT relations.
- render :text => doc.to_s, :content_type => "text/xml"
- else
- render :text => "You need to supply a comma separated list of ids.", :status => :bad_request
+ Relation.find(ids).each do |relation|
+ doc.root << relation.to_xml_node
- relationids = RelationMember.find(:all, :conditions => ['member_type=? and member_id=?', objtype, params[:id]]).collect { |ws| ws.id[0] }.uniq
+ relationids = RelationMember.where(:member_type => objtype, :member_id => params[:id]).collect { |ws| ws.relation_id }.uniq