1
0
Fork 0

Improve method Profile#full_name

master
Alex Kotov 2 years ago
parent fca3cfa071
commit 9bd7a6fa13
  1. 3
      app/models/profile.rb

@ -2,6 +2,7 @@ class Profile < ApplicationRecord
has_many :posts
def full_name
[first_name, last_name].map(&:presence).compact.join ' '
[first_name, last_name].map(&:presence).compact.join(' ').presence ||
"Profile#{" ##{id}" if id.present?}"
end
end