Improve method Profile#full_name
This commit is contained in:
parent
fca3cfa071
commit
9bd7a6fa13
|
@ -2,6 +2,7 @@ class Profile < ApplicationRecord
|
||||||
has_many :posts
|
has_many :posts
|
||||||
|
|
||||||
def full_name
|
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
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue