- # code in 6 places for all the updates and deletes. Some of these tests are
- # needed for creates, but are currently not run :-(
+ # code in 6 places for all the updates and deletes. Some of these tests are
+ # needed for creates, but are currently not run :-(
# This will throw an exception if there is an inconsistency
def check_consistency(old, new, user)
if new.id != old.id or new.id.nil? or old.id.nil?
# This will throw an exception if there is an inconsistency
def check_consistency(old, new, user)
if new.id != old.id or new.id.nil? or old.id.nil?
# This is similar to above, just some validations don't apply
def check_create_consistency(new, user)
if new.changeset.nil?
# This is similar to above, just some validations don't apply
def check_create_consistency(new, user)
if new.changeset.nil?
raise OSM::APIUserChangesetMismatchError.new
elsif not changeset.is_open?
raise OSM::APIChangesetAlreadyClosedError.new(changeset)
raise OSM::APIUserChangesetMismatchError.new
elsif not changeset.is_open?
raise OSM::APIChangesetAlreadyClosedError.new(changeset)