Module: AdSpace::ApplicationHelper

Defined in:
app/helpers/ad_space/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#user_identifier(user) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/ad_space/application_helper.rb', line 3

def user_identifier(user)
  if user.respond_to?(:email) && user.email.present?
    user.email
  elsif user.respond_to?(:username) && user.username.present?
    user.username.camelize
  elsif user.respond_to?(:name) && user.name.present?
    user.name.camelize
  else
    user.id
  end
end