Skip to content

Commit

Permalink
[Rubocop] Use safe navigation (&.) instead of checking if an object e…
Browse files Browse the repository at this point in the history
…xists before calling the method
  • Loading branch information
dieggofaustino committed Aug 23, 2017
1 parent 1112a5a commit 9df7430
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/operations/note_operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def notify_users
return if users_to_notify.none? || story.suppress_notifications

notifier = Notifications.new_note(model.id, users_to_notify.map(&:email))
notifier.deliver if notifier
notifier&.deliver
end

def users_from_note
Expand Down
10 changes: 4 additions & 6 deletions lib/tasks/i18n_missing_keys.rake
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ class MissingKeysFinder
I18n.available_locales.each do |locale|
skip = false
ls = locale.to_s
unless @yaml[ls].nil?
@yaml[ls].each do |re|
if key.match(re)
skip = true
break
end
@yaml[ls]&.each do |re|
if key.match(re)
skip = true
break
end
end

Expand Down

0 comments on commit 9df7430

Please sign in to comment.