X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1f8a68371ad34594cce4aadf5fef229588fd4ddc..1721aa1c0dd7e5d3f1f87054cf63040e5d914671:/app/models/changeset.rb?ds=sidebyside diff --git a/app/models/changeset.rb b/app/models/changeset.rb index d41a82989..fa2d556b1 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -85,6 +85,10 @@ class Changeset < ActiveRecord::Base def bbox @bbox ||= [ min_lon, min_lat, max_lon, max_lat ] end + + def has_valid_bbox? + not bbox.include? nil + end ## # expand the bounding box to include the given bounding box. also, @@ -221,7 +225,7 @@ class Changeset < ActiveRecord::Base def update_from(other, user) # ensure that only the user who opened the changeset may modify it. unless user.id == self.user_id - raise OSM::APIUserChangesetMismatchError + raise OSM::APIUserChangesetMismatchError.new end # can't change a closed changeset