- # delete a way and its nodes that aren't part of other ways
- # this functionality used to be in the model, however it is specific to amf
- # controller
- #def delete_unshared_nodes(changeset_id, way_id)
-
- # Remove a node or way from all relations
- # FIXME needs version, changeset, and user
- # Fixme make sure this doesn't depend on anything and delete this, as potlatch
- # itself should remove the relations first
- def deleteitemrelations(objid, type, version) #:doc:
- relations = RelationMember.find(:all,
- :conditions => ['member_type = ? and member_id = ?', type, objid],
- :include => :relation).collect { |rm| rm.relation }.uniq
-
- relations.each do |rel|
- rel.members.delete_if { |x| x[0] == type and x[1] == objid }
- # FIXME need to create the new relation
- new_rel = Relation.new
- new_rel.version = version
- new_rel.members = members
- new_rel.changeset = changeset
- rel.delete_with_history(new_rel, user)
- end
- end
-
- # Break out node tags into a hash
- # (should become obsolete as of API 0.6)
-
- def tagstring_to_hash(a) #:doc:
- tags={}
- Tags.split(a) do |k, v|
- tags[k]=v
- end
- tags
- end
-