More efficient listing of roles

Reduces number of loops from 2 to 1.
This commit is contained in:
Justin Harrison 2016-03-29 12:04:48 -04:00
parent 7c38622e8f
commit 18b1ad2b70

View file

@ -28,10 +28,9 @@
= registration.id = registration.id
%td %td
= registration.name = registration.name
- @conference.roles.each do |role| - registration.user.roles.each do |role|
- role.users.each do |user| - if role.resource == @conference
- if user == registration.user %span.label.label-info= role.name.titleize
%span.label.label-info= role.name.titleize
%td %td
= registration.email = registration.email
%td %td