Class: Role

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

Class Method Summary collapse

Class Method Details

.adminObject



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

def self.admin
  @admin ||= find_by_name("Admin")
end

.collection_entriesObject



21
22
23
24
25
26
27
# File 'app/models/role.rb', line 21

def self.collection_entries
  roles = [["Not Set", nil]]
  Role.all.map{|t| [t.name, t.id]}.each do |t|
    roles << t
  end
  roles
end

.nobodyObject



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

def self.nobody
  @nobody ||= find_by_name("Nobody")
end

.rootObject



5
6
7
# File 'app/models/role.rb', line 5

def self.root
  @root ||= find_by_name("Super")
end

.userObject



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

def self.user
  @user ||= find_by_name("User")
end