Class: Role
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Role
- Defined in:
- app/models/role.rb
Class Method Summary collapse
Class Method Details
.admin ⇒ Object
17 18 19 |
# File 'app/models/role.rb', line 17 def self.admin @admin ||= find_by_name("Admin") end |
.collection_entries ⇒ Object
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 |
.nobody ⇒ Object
9 10 11 |
# File 'app/models/role.rb', line 9 def self.nobody @nobody ||= find_by_name("Nobody") end |
.root ⇒ Object
5 6 7 |
# File 'app/models/role.rb', line 5 def self.root @root ||= find_by_name("Super") end |
.user ⇒ Object
13 14 15 |
# File 'app/models/role.rb', line 13 def self.user @user ||= find_by_name("User") end |