This 'elegant' helper for showing the user/member status is working perfectly for CASE 1-3 but not working (not showing anything at ERB view <%= user_cat %>) for:
- user.plan_id=NULL
What's the error? How to fix it?
def user_cat
if user_signed_in?
case current_user.plan_id
when 1
'ESPORÀDIC'
when 2
'FREQÜENT'
when 3
'HABITUAL'
end
else
'IDENTIFICA\'T'
end
end
Ruby 2.64 and Rails 6.0.0
Thanks in advance!