Class: Elabs::User

Inherits:
ApplicationRecord show all
Defined in:
app/models/elabs/user.rb

Instance Attribute Summary

Attributes inherited from ApplicationRecord

#changed_by

Instance Method Summary collapse

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/elabs/user.rb', line 28

def admin?
  role == 'admin'
end

#display_nameObject



32
33
34
# File 'app/models/elabs/user.rb', line 32

def display_name
  real_name.present? ? real_name : "@#{username}"
end