Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.guest_userObject



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

def self.guest_user
  where(email: '[email protected]', role: Role::ADMIN_ROLE, name: 'Guest').first_or_create
end

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/models/user.rb', line 20

def admin?
  role == Role::ADMIN_ROLE
end