Fix Style/NumericPredicate rubocop warnings

This commit is contained in:
Tom Hughes 2018-09-22 17:34:58 +01:00
parent 64146b4f36
commit de29e9b3f5
14 changed files with 21 additions and 42 deletions

View file

@ -275,7 +275,7 @@ class Relation < ActiveRecord::Base
def fix_placeholders!(id_map, placeholder_id = nil)
members.map! do |type, id, role|
old_id = id.to_i
if old_id < 0
if old_id.negative?
new_id = id_map[type.downcase.to_sym][old_id]
raise OSM::APIBadUserInput, "Placeholder #{type} not found for reference #{old_id} in relation #{self.id.nil? ? placeholder_id : self.id}." if new_id.nil?