From 18b1ad2b70616230cab1d524559dc60a211f7f19 Mon Sep 17 00:00:00 2001 From: Justin Harrison Date: Tue, 29 Mar 2016 12:04:48 -0400 Subject: [PATCH] More efficient listing of roles Reduces number of loops from 2 to 1. --- app/views/admin/registrations/index.html.haml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/admin/registrations/index.html.haml b/app/views/admin/registrations/index.html.haml index 73003021..d3ac590b 100644 --- a/app/views/admin/registrations/index.html.haml +++ b/app/views/admin/registrations/index.html.haml @@ -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