Class: Admin

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

Defined Under Namespace

Classes: TestingUserSessionsController

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.current_adminObject

Used in ActiveAdmin to save the current_admin in this class on before_action, and access it everywhere


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

def current_admin
  @current_admin
end

Instance Method Details

#adminsObject


24
25
26
# File 'app/models/admin.rb', line 24

def admins
  Admin.where(id: id)
end

#root?Boolean

Returns:


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

def root?
  scoped_organization_code.blank?
end

#scoped?Boolean

Returns:


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

def scoped?
  !scoped_organization_code.blank?
end