Verified Commit 424a7882 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

set profile_entity as class variable, in order to evaluate it only once on the instance

parent e979ba9c
......@@ -126,13 +126,13 @@ class User < ApplicationRecord
end
def profile_entity
if volunteer?
volunteer
elsif profile
profile
else
self
end
@profile_entity ||= if volunteer?
volunteer
elsif profile
profile
else
self
end
end
def missing_profile?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment