Class: Iron::User

Inherits:
ApplicationRecord show all
Includes:
Deactivatable, Role
Defined in:
app/models/iron/user.rb

Defined Under Namespace

Modules: Deactivatable, Role

Constant Summary collapse

ADMIN_LANGUAGES =
%w[en it].freeze

Constants included from Role

Role::PEOPLE_ROLES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Role

#can_administer?, #can_write?

Methods included from Deactivatable

#deactivate, #reactivate

Class Method Details

.systemObject



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

def self.system
  systems.first || create!(authenticatable: System.new, role: :administrator)
end

Instance Method Details

#current?Boolean

Returns:

  • (Boolean)


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

def current?
  self == Current.user
end

#initialsObject



36
37
38
# File 'app/models/iron/user.rb', line 36

def initials
  name[0..1]
end