X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/860887de5272c3e2a39cb7e0c9db6f0acba1b4c6..5f4dcd34ff5943ff4de39bc8322013376a6de8b9:/app/models/way.rb?ds=sidebyside diff --git a/app/models/way.rb b/app/models/way.rb index d0a252803..ecbdd2f9c 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -58,7 +58,7 @@ class Way < ActiveRecord::Base way.id = pt["id"].to_i # .to_i will return 0 if there is no number that can be parsed. # We want to make sure that there is no id with zero anyway - raise OSM::APIBadUserInput.new("ID of way cannot be zero when updating.") if way.id == 0 + raise OSM::APIBadUserInput.new("ID of way cannot be zero when updating.") if way.id.zero? end # We don't care about the timestamp nor the visibility as these are either @@ -222,7 +222,7 @@ class Way < ActiveRecord::Base lock! check_consistency(self, new_way, user) rels = Relation.joins(:relation_members).where(:visible => true, :current_relation_members => { :member_type => "Way", :member_id => id }).order(:id) - raise OSM::APIPreconditionFailedError.new("Way #{id} is still used by relations #{rels.collect(&:id).join(",")}.") unless rels.empty? + raise OSM::APIPreconditionFailedError.new("Way #{id} is still used by relations #{rels.collect(&:id).join(',')}.") unless rels.empty? self.changeset_id = new_way.changeset_id self.changeset = new_way.changeset