X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/ca5de5b4e01297b07ce3a9db45e908f15f7cda11..e104b5371120be77591a6d66a4a48064e20faad7:/app/models/way.rb 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