Fix Style/SafeNavigation rubocop warnings

This commit is contained in:
Tom Hughes 2018-09-22 17:21:06 +01:00
parent 6c2093b29d
commit 64146b4f36
16 changed files with 34 additions and 59 deletions

View file

@ -260,7 +260,7 @@ class Relation < ActiveRecord::Base
element = model.lock("for share").find_by(:id => m[1])
# and check that it is OK to use.
raise OSM::APIPreconditionFailedError, "Relation with id #{id} cannot be saved due to #{m[0]} with id #{m[1]}" unless element && element.visible? && element.preconditions_ok?
raise OSM::APIPreconditionFailedError, "Relation with id #{id} cannot be saved due to #{m[0]} with id #{m[1]}" unless element&.visible? && element&.preconditions_ok?
hash[m[1]] = true
end