]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/node.rb
Fix new rubocop warnings
[rails.git] / app / models / node.rb
index a6814405c731195442304ee1f08d90107061d2cc..a5becbf4d0b2e4ff260416fe2c6e7092124c68d0 100644 (file)
@@ -81,7 +81,7 @@ class Node < ActiveRecord::Base
       node.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
       node.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 node cannot be zero when updating.") if node.id == 0
+      raise OSM::APIBadUserInput.new("ID of node cannot be zero when updating.") if node.id.zero?
     end
 
     # We don't care about the time, as it is explicitly set on create/update/delete
     end
 
     # We don't care about the time, as it is explicitly set on create/update/delete