@ -10,7 +10,9 @@ module Admin
|
||||
|
||||
# TODO: Limit results to the quizzes current_user has access to
|
||||
def index
|
||||
@candidates = Candidate.where(completed: true).includes(:recruiter)
|
||||
@candidates = Candidate.where(completed: true)
|
||||
.includes(:recruiter)
|
||||
.order(:review_status, completed_at: :desc)
|
||||
end
|
||||
|
||||
def view
|
||||
|
@ -35,7 +35,7 @@ class QuizController < ApplicationController
|
||||
private
|
||||
|
||||
def complete_and_email
|
||||
if current_candidate.update_attributes(completed: true)
|
||||
if current_candidate.update_attributes(completed: true, completed_at: DateTime.current)
|
||||
current_candidate.build_reviews
|
||||
CandidateMailer.submitted(current_candidate).deliver_later
|
||||
RecruiterMailer.candidate_submitted(current_candidate).deliver_later
|
||||
|
@ -8,6 +8,7 @@
|
||||
<th>Test ID</th>
|
||||
<th>Experience</th>
|
||||
<th>Recruiter</th>
|
||||
<th>Submitted on</th>
|
||||
<th>Interview?</th>
|
||||
</tr>
|
||||
|
||||
@ -16,6 +17,7 @@
|
||||
<td><%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %></td>
|
||||
<td><%= candidate.experience %> years</td>
|
||||
<td><%= mail_to(candidate.recruiter.email) %></td>
|
||||
<td><%= candidate.completed_at.strftime('%D') unless candidate.completed_at.nil? %></td>
|
||||
<td><%= candidate.interview? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
Reference in New Issue
Block a user