diff --git a/app/models/candidate.rb b/app/models/candidate.rb
index f75a738..21e6ac8 100644
--- a/app/models/candidate.rb
+++ b/app/models/candidate.rb
@@ -23,6 +23,11 @@ class Candidate < ApplicationRecord
declined: 2
}
+ def interview?
+ return 'yes' if approved?
+ 'no' if declined?
+ end
+
def build_reviews
reviewers.each do |reviewer|
votes.find_or_create_by(user_id: reviewer.id)
diff --git a/app/views/admin/candidate/index.html.erb b/app/views/admin/candidate/index.html.erb
index 67f464b..e2e2302 100644
--- a/app/views/admin/candidate/index.html.erb
+++ b/app/views/admin/candidate/index.html.erb
@@ -16,7 +16,7 @@
Progress |
Completed |
Reminded |
- Interview Request |
+ Interview? |
<% @candidates.each do |candidate| %>
@@ -32,7 +32,7 @@
<%= candidate.status %> |
<%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %> |
<%= candidate.reminded ? "Yes" : "" %> |
- <%= candidate.review_status unless candidate.pending? %> |
+ <%= candidate.interview? %> |
<% end %>
diff --git a/app/views/admin/result/_voting.html.erb b/app/views/admin/result/_voting.html.erb
index bc04725..3c89df9 100644
--- a/app/views/admin/result/_voting.html.erb
+++ b/app/views/admin/result/_voting.html.erb
@@ -1,4 +1,4 @@
-<% # TODO: This needs to be extracted into a decorator, or something. It is only a quick hack solution. %>
+<% # TODO: This should be extracted into a decorator, or something. It is only a quick hack solution. %>
<% if current_user.acts_as_reviewer? %>
<% else %>
Candidate Interview Status: <%= @candidate.review_status %>
diff --git a/app/views/admin/result/index.html.erb b/app/views/admin/result/index.html.erb
index 79ed6de..dd05923 100644
--- a/app/views/admin/result/index.html.erb
+++ b/app/views/admin/result/index.html.erb
@@ -8,7 +8,7 @@
Test ID |
Experience |
Recruiter |
- Interview Request |
+ Interview? |
<% @candidates.each do |candidate| %>
@@ -16,7 +16,7 @@
<%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %> |
<%= candidate.experience %> years |
<%= mail_to(candidate.recruiter.email) %> |
- <%= candidate.review_status unless candidate.pending? %> |
+ <%= candidate.interview? %> |
<% end %>