Class: User

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

Defined Under Namespace

Classes: ConfirmationsController, Form, PasswordsController, RegistrationsController, SessionsController, UnlocksController

Instance Method Summary collapse

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/user.rb', line 13

def admin?
  roles.include?('admin')
end

#rolesObject



9
10
11
# File 'app/models/user.rb', line 9

def roles
  read_attribute(:roles) || []
end