X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6c66507427961a22a8f282b5b2f4ab7fda1dad6f..0b6d9ce877a08cb762b5d9354847187c6b43e216:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index 97f44c117..2b6f562be 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -200,7 +200,7 @@ class Way < ActiveRecord::Base def update_from(new_way, user) check_consistency(self, new_way, user) unless new_way.preconditions_ok? - raise OSM::APIPreconditionFailedError("Cannot update way #{self.id}: data is invalid.") + raise OSM::APIPreconditionFailedError.new("Cannot update way #{self.id}: data is invalid.") end self.changeset_id = new_way.changeset_id @@ -214,7 +214,7 @@ class Way < ActiveRecord::Base def create_with_history(user) check_create_consistency(self, user) unless self.preconditions_ok? - raise OSM::APIPreconditionFailedError("Cannot create way: data is invalid.") + raise OSM::APIPreconditionFailedError.new("Cannot create way: data is invalid.") end self.version = 0 self.visible = true @@ -237,7 +237,7 @@ class Way < ActiveRecord::Base def delete_with_history!(new_way, user) unless self.visible - raise OSM::APIAlreadyDeletedError + raise OSM::APIAlreadyDeletedError.new("way", new_way.id) end # need to start the transaction here, so that the database can