X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f1935b1c5786de8f27bee9b6b2da2f28f650468f..f50ca826aad559c77f948ccca61cbdc0bbddf3d1:/app/models/concerns/consistency_validations.rb diff --git a/app/models/concerns/consistency_validations.rb b/app/models/concerns/consistency_validations.rb index 8c89f61de..97b6743eb 100644 --- a/app/models/concerns/consistency_validations.rb +++ b/app/models/concerns/consistency_validations.rb @@ -16,20 +16,14 @@ module ConsistencyValidations raise OSM::APIChangesetMissingError elsif new.changeset.user_id != user.id raise OSM::APIUserChangesetMismatchError - elsif !new.changeset.is_open? + elsif !new.changeset.open? raise OSM::APIChangesetAlreadyClosedError, new.changeset end end # This is similar to above, just some validations don't apply def check_create_consistency(new, user) - if new.changeset.nil? - raise OSM::APIChangesetMissingError - elsif new.changeset.user_id != user.id - raise OSM::APIUserChangesetMismatchError - elsif !new.changeset.is_open? - raise OSM::APIChangesetAlreadyClosedError, new.changeset - end + check_changeset_consistency(new.changeset, user) end ## @@ -42,7 +36,7 @@ module ConsistencyValidations raise OSM::APIChangesetMissingError elsif user.id != changeset.user_id raise OSM::APIUserChangesetMismatchError - elsif !changeset.is_open? + elsif !changeset.open? raise OSM::APIChangesetAlreadyClosedError, changeset end end