X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/de29e9b3f59d7a06fbe2e32096328bd8a6ed2b3a..6ca22de4f2c68e4b14a6e2f0938a8657c33adc31:/app/models/relation.rb diff --git a/app/models/relation.rb b/app/models/relation.rb index d5117b7c3..f55711a69 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -381,10 +381,12 @@ class Relation < ActiveRecord::Base # reasonable on the assumption that adding or removing members doesn't # materially change the rest of the relation. any_relations = - changed_members.collect { |_id, type| type == "relation" } + changed_members.collect { |type, _id, _role| type == "Relation" } .inject(false) { |acc, elem| acc || elem } - update_members = if tags_changed || any_relations + # if the relation is being deleted tags_changed will be true and members empty + # so we need to use changed_members to create a correct bounding box + update_members = if visible && (tags_changed || any_relations) # add all non-relation bounding boxes to the changeset # FIXME: check for tag changes along with element deletions and # make sure that the deleted element's bounding box is hit.