* Throw away old system * Add new system * Add new example files * Replace all calls * add the most important docs * Add Specs * rename disable_ssl_requirement to require_ssl * cloudfiles isn't used/called in our code * since community_spotlight.list is only used as enable flag replace it with such one and remove all legacy and irelevant codepaths around it * die if session secret is unset and on heroku * First basic infrastructure for version information
16 lines
404 B
Ruby
16 lines
404 B
Ruby
#NOTE add the person object you want to attach role to...
|
|
class Role < ActiveRecord::Base
|
|
belongs_to :person
|
|
|
|
def self.is_admin?(person)
|
|
find_by_person_id_and_name(person.id, 'admin')
|
|
end
|
|
|
|
def self.add_admin(person)
|
|
find_or_create_by_person_id_and_name(person.id, 'admin')
|
|
end
|
|
|
|
def self.add_spotlight(person)
|
|
find_or_create_by_person_id_and_name(person.id, 'spotlight')
|
|
end
|
|
end
|