you could say if transaction.account
or transcation.account.try(:name)