X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9ff7ea8d71dedb5b29f6ff0b007568b3e699b196..788e817e4a8d9364827b12d77cdb82971b7e74b1:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index cbbe6ada4..637f41e28 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 @@ -224,7 +224,7 @@ class Way < ActiveRecord::Base def preconditions_ok? return false if self.nds.empty? if self.nds.length > APP_CONFIG['max_number_of_way_nodes'] - raise OSM::APITooManyWayNodesError.new(self.nds.count, APP_CONFIG['max_number_of_way_nodes']) + raise OSM::APITooManyWayNodesError.new(self.nds.length, APP_CONFIG['max_number_of_way_nodes']) end self.nds.each do |n| node = Node.find(:first, :conditions => ["id = ?", n])