From 3129c196faac7de0b7d01df232e859c7600cb692 Mon Sep 17 00:00:00 2001 From: Nishanth Vijayan Date: Thu, 17 Mar 2016 00:53:50 +0530 Subject: [PATCH] Add rake task to re-add deleted roles from all conferences --- lib/tasks/roles.rake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/tasks/roles.rake diff --git a/lib/tasks/roles.rake b/lib/tasks/roles.rake new file mode 100644 index 00000000..8c817db0 --- /dev/null +++ b/lib/tasks/roles.rake @@ -0,0 +1,15 @@ +namespace :roles do + desc 'Adds back deleted roles to all conferences' + task add: :environment do + + Conference.all.each do |c| + Role.where(name: 'organizer', resource: c).first_or_create(description: 'For the organizers of the conference (who shall have full access)') + Role.where(name: 'cfp', resource: c).first_or_create(description: 'For the members of the CfP team') + Role.where(name: 'info_desk', resource: c).first_or_create(description: 'For the members of the Info Desk team') + Role.where(name: 'volunteers_coordinator', resource: c).first_or_create(description: 'For the people in charge of volunteers') + end + + puts 'All done!' + end +end +