Use Ruby safe navigation over Rails try

re: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/SafeNavigation
This commit is contained in:
James Mason 2018-05-08 14:17:30 -07:00
parent 7c60910410
commit a5f97e6bf2
No known key found for this signature in database
GPG key ID: 1B3951886C449023
11 changed files with 26 additions and 27 deletions

View file

@ -133,7 +133,7 @@ class User < ApplicationRecord
def self.for_ichain_username(username, attributes)
user = find_by(username: username)
raise UserDisabled if user && user.is_disabled
raise UserDisabled if user&.is_disabled
if user
user.update_attributes(email: attributes[:email],