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
%td
= registration.name
- @conference.roles.each do |role|
- role.users.each do |user|
- if user == registration.user
%span.label.label-info= role.name.titleize
- registration.user.roles.each do |role|
- if role.resource == @conference
%span.label.label-info= role.name.titleize
%td
= registration.email
%td