real_name takes time
This commit is contained in:
parent
8e2c74bdd2
commit
cedf4302a7
1 changed files with 9 additions and 4 deletions
|
|
@ -68,12 +68,17 @@ class Person
|
|||
end
|
||||
|
||||
def real_name
|
||||
if profile.first_name.nil? || profile.first_name.empty?
|
||||
result = nil
|
||||
time = Benchmark.realtime do
|
||||
result = if profile.first_name.nil? || profile.first_name.empty?
|
||||
self.diaspora_handle
|
||||
else
|
||||
"#{profile.first_name.to_s} #{profile.last_name.to_s}"
|
||||
end
|
||||
end
|
||||
Rails.logger.info "event=real_name ms=#{time}"
|
||||
result
|
||||
end
|
||||
|
||||
def owns?(post)
|
||||
self.id == post.person.id
|
||||
|
|
|
|||
Loading…
Reference in a new issue