Fix get_roles method of User model

Previous implementation was associating resources with all
the roles regardless of user role in the resource. ie:
if user is cfp member of conf1, the method was returning:
{ organizer => conf1,
  cfp => conf1,
  Info Desk => conf1,
  Volunteers Coordinator => conf1
}
This commit is contained in:
Aditya Prakash 2016-04-17 11:32:06 +05:30
parent 3c356cbaaf
commit 7e04a267cb
4 changed files with 19 additions and 6 deletions

View file

@ -274,7 +274,7 @@ module ApplicationHelper
# Outputs the roles of a user, including the conferences for which the user has the roles
# Eg. organizer(oSC13, oSC14), cfp(oSC12, oSC13)
def show_roles(roles)
roles.map { |x| x[0].titleize + ' ' + x[1] }.join ', '
roles.map{ |x| x[0].titleize + ' (' + x[1].join(', ') + ')' }.join ', '
end
def can_manage_volunteers(conference)