Refactor create element consistency check
This commit is contained in:
parent
50df5eefcc
commit
f50ca826aa
4 changed files with 79 additions and 7 deletions
|
@ -23,13 +23,7 @@ module ConsistencyValidations
|
|||
|
||||
# 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.open?
|
||||
raise OSM::APIChangesetAlreadyClosedError, new.changeset
|
||||
end
|
||||
check_changeset_consistency(new.changeset, user)
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue