Class: Role

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

Overview

NOTE add the person object you want to attach role to…

Class Method Summary collapse

Class Method Details

.add_admin(person) ⇒ Object


11
12
13
# File 'app/models/role.rb', line 11

def self.add_admin(person)
  find_or_create_by_person_id_and_name(person.id, 'admin')
end

.add_spotlight(person) ⇒ Object


15
16
17
# File 'app/models/role.rb', line 15

def self.add_spotlight(person)
  find_or_create_by_person_id_and_name(person.id, 'spotlight')
end

.is_admin?(person) ⇒ Boolean


7
8
9
# File 'app/models/role.rb', line 7

def self.is_admin?(person)
  find_by_person_id_and_name(person.id, 'admin')
end