This commit is contained in:
Hernán Schmidt 2017-07-13 18:18:51 +00:00 committed by GitHub
commit caa1a26b0a
11 changed files with 332 additions and 507 deletions

View file

@ -13,11 +13,11 @@ module Admin
def show
if can_manage_volunteers?(@conference)
if @conference.use_vpositions
@volunteers = @conference.registrations.joins(:vchoices).uniq
else
@volunteers = @conference.registrations.where(volunteer: true)
end
@volunteers = if @conference.use_vpositions
@conference.registrations.joins(:vchoices).uniq
else
@conference.registrations.where(volunteer: true)
end
else
authorize! :index, :volunteer
end

View file

@ -38,12 +38,12 @@ class ConferenceRegistrationsController < ApplicationController
def create
@registration = @conference.registrations.new(registration_params)
if current_user.nil?
# @user variable needs to be set so that _sign_up_form_embedded works properly
@user = @registration.build_user(user_params)
else
@user = current_user
end
@user = if current_user.nil?
# @user variable needs to be set so that _sign_up_form_embedded works properly
@registration.build_user(user_params)
else
current_user
end
@registration.user = @user
authorize! :create, @registration