Class: User

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

Overview

This model manage the users

Relations

has many Happening

Validates

Instance Attribute Summary collapse

Instance Attribute Details

#adminBoolean

Returns [true] if User is an admin.

Returns:

  • (Boolean)
    true

    if User is an admin


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#created_atDateTime

Returns when the record was created.

Returns:

  • (DateTime)

    when the record was created


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#current_sign_in_atDateTime

Returns Time of current sign in.

Returns:

  • (DateTime)

    Time of current sign in


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#current_sign_in_ipInet

Returns ip of current sign in.

Returns:

  • (Inet)

    ip of current sign in


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#editorBoolean

Returns [true] if User is an editor.

Returns:

  • (Boolean)
    true

    if User is an editor


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#idInteger

Returns unique identifier for User.

Returns:

  • (Integer)

    unique identifier for User


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#last_sign_in_atDateTime

Returns Time of last sign in.

Returns:

  • (DateTime)

    Time of last sign in


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#last_sign_in_ipInet

Returns ip of last sign in.

Returns:

  • (Inet)

    ip of last sign in


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#sign_in_countInteger

Returns sign in count for User, default is 0, null is false.

Returns:

  • (Integer)

    sign in count for User, default is 0, null is false


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#updated_atDateTime

Returns when the record was updated.

Returns:

  • (DateTime)

    when the record was updated


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end

#usernameString

Returns unique login name for User.

Returns:

  • (String)

    unique login name for User


31
32
33
34
35
36
37
38
# File 'app/models/user.rb', line 31

class User < ApplicationRecord
  devise Settings.devise, :timeoutable, :trackable
  has_many :tickets
  has_and_belongs_to_many :groups
  has_many :facts, through: :groups

  validates :username, presence: true, uniqueness: true
end