Class: BotUser

Inherits:
AbstractUser show all
Defined in:
app/models/bot_user.rb

Constant Summary collapse

ROLES =
['match_editor']

Class Method Summary collapse

Methods inherited from AbstractUser

#ability, default_user_role, #name, #owns_role?, #to_s

Class Method Details

.create(attributes = nil, &block) ⇒ Object

Raises:

  • (TypeError)


16
17
18
19
# File 'app/models/bot_user.rb', line 16

def self.create(attributes = nil, &block)
  raise TypeError, 'Botuser already exist' if first
  super
end

.create!(attributes = nil, &block) ⇒ Object

Raises:

  • (TypeError)


21
22
23
24
# File 'app/models/bot_user.rb', line 21

def self.create!(attributes = nil, &block)
  raise TypeError, 'Botuser already exist' if first
  super
end

.instanceObject



6
7
8
9
10
11
12
13
14
# File 'app/models/bot_user.rb', line 6

def self.instance
  first_or_create(
    email: 'botuser@iqvoc',
    password: 'botuser',
    password_confirmation: 'botuser',
    role: 'match_editor',
    active: true
  )
end