Add and apply Style/SafeNavigation rubocop rule

We were already using it most of the time, but not always.
This commit is contained in:
Javi Martín
2019-10-10 03:02:45 +02:00
parent 6ceca143b4
commit 1004ac01f8
10 changed files with 22 additions and 19 deletions

View File

@@ -108,7 +108,7 @@ class Legislation::Proposal < ApplicationRecord
end
def votable_by?(user)
user && user.level_two_or_three_verified?
user&.level_two_or_three_verified?
end
def register_vote(user, vote_value)
@@ -142,7 +142,7 @@ class Legislation::Proposal < ApplicationRecord
protected
def set_responsible_name
if author && author.document_number?
if author&.document_number?
self.responsible_name = author.document_number
end
end