Roles into their own controller. Rework interface. Add flash messages to ajax calls. Add description to roles. Possible to edit roles in use.

This commit is contained in:
Stella 2015-01-12 23:13:10 +02:00 committed by Stella Rouzi
parent eda5c2bc07
commit ccd7ecbb90
59 changed files with 618 additions and 356 deletions

View file

@ -3,7 +3,8 @@
class Conference < ActiveRecord::Base
require 'uri'
serialize :events_per_week, Hash
resourcify # Needed to call 'Conference.with_role' in /models/ability.rb
# Needed to call 'Conference.with_role' in /models/ability.rb
resourcify
default_scope { order('start_date DESC') }
@ -545,6 +546,18 @@ class Conference < ActiveRecord::Base
after_create do
self.create_contact
self.create_program
create_roles
end
##
# Creates the roles of the conference
# after the conference has been successfully created
# Will create 4 new records for roles
def create_roles
Role.where(name: 'organizer', resource: self).first_or_create(description: 'For the organizers of the conference (who shall have full access)')
Role.where(name: 'cfp', resource: self).first_or_create(description: 'For the members of the CfP team')
Role.where(name: 'info_desk', resource: self).first_or_create(description: 'For the members of the Info Desk team')
Role.where(name: 'volunteers_coordinator', resource: self).first_or_create(description: 'For the people in charge of volunteers')
end
##