Fixes #4 - check_in freezes site
This commit is contained in:
parent
21d9d3a48a
commit
12d14a7e40
@ -311,8 +311,13 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
}
|
}
|
||||||
|
|
||||||
@registration_data = []
|
@registration_data = []
|
||||||
User.all.each do |user|
|
|
||||||
if user.email.present?
|
registrations = ConferenceRegistration.where(conference_id: @this_conference.id).includes(:user, :user => :organizations)
|
||||||
|
|
||||||
|
registrations.each do |registration|
|
||||||
|
user = registration.user
|
||||||
|
next unless user&.email.present?
|
||||||
|
|
||||||
new_data = {
|
new_data = {
|
||||||
user_id: user.id,
|
user_id: user.id,
|
||||||
email: user.email,
|
email: user.email,
|
||||||
@ -322,8 +327,7 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
organization = user.organizations.first
|
organization = user.organizations.first
|
||||||
new_data[:organization] = organization.present? ? organization.name : ''
|
new_data[:organization] = organization.present? ? organization.name : ''
|
||||||
|
|
||||||
registration = @this_conference.registration_for(user)
|
if registration.city_id.present?
|
||||||
if registration.present? && registration.city_id.present?
|
|
||||||
new_data[:location] = registration.city.to_s
|
new_data[:location] = registration.city.to_s
|
||||||
status = registration.status
|
status = registration.status
|
||||||
else
|
else
|
||||||
@ -336,7 +340,6 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
|
|
||||||
@registration_data << new_data
|
@registration_data << new_data
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
@registration_data.sort! { |a, b| b[:sort_weight] <=> a[:sort_weight] }
|
@registration_data.sort! { |a, b| b[:sort_weight] <=> a[:sort_weight] }
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user