diff --git a/Guardfile b/Guardfile index 7a847c9..1027353 100644 --- a/Guardfile +++ b/Guardfile @@ -75,7 +75,7 @@ guard :shell, all_on_start: true do # TODO: Annoyingly, all files are linted twice on start/full runs. Why? watch %r{app/assets/javascripts/*/.*} do |file| system %(echo "ESLint:\033[32m #{file[0]}\033[0m") - system %(eslint #{file[0]}) + system %(./node_modules/eslint/bin/eslint.js #{file[0]}) end end diff --git a/app/assets/images/thumb-down-red.png b/app/assets/images/thumb-down-red.png deleted file mode 100644 index 13c46e7..0000000 Binary files a/app/assets/images/thumb-down-red.png and /dev/null differ diff --git a/app/assets/images/thumb-down.png b/app/assets/images/thumb-down.png deleted file mode 100644 index 9cd2fb3..0000000 Binary files a/app/assets/images/thumb-down.png and /dev/null differ diff --git a/app/assets/images/thumb-up-green.png b/app/assets/images/thumb-up-green.png deleted file mode 100644 index 272a9b5..0000000 Binary files a/app/assets/images/thumb-up-green.png and /dev/null differ diff --git a/app/assets/images/thumb-up.png b/app/assets/images/thumb-up.png deleted file mode 100644 index 930eb04..0000000 Binary files a/app/assets/images/thumb-up.png and /dev/null differ diff --git a/app/models/user.rb b/app/models/user.rb index 7db5e31..a563182 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,6 +6,8 @@ class User < ApplicationRecord has_many :quizzes, through: :reviewer_to_quizzes has_many :votes, class_name: 'ReviewerVote' + has_many :reviewees, through: :quizzes, source: :candidates + validates :email, presence: true, uniqueness: true validates :name, presence: true validates :role, presence: true diff --git a/app/policies/reviewer_vote_policy.rb b/app/policies/reviewer_vote_policy.rb index 78de734..3455425 100644 --- a/app/policies/reviewer_vote_policy.rb +++ b/app/policies/reviewer_vote_policy.rb @@ -8,8 +8,7 @@ class ReviewerVotePolicy < ApplicationPolicy # Only Managers, and Admins, can veto a quiz result def up? - # return true if user.acts_as_admin? - # user.quizzes.include? record.candidate.quiz + # return true if user.reviewees.include? record.candidate true end diff --git a/app/views/admin/user/_form.html.erb b/app/views/admin/user/_form.html.erb index c3b5266..de44d21 100644 --- a/app/views/admin/user/_form.html.erb +++ b/app/views/admin/user/_form.html.erb @@ -15,12 +15,20 @@ <%= form.select :role, admin_role_options(user.role), include_blank: false %> - <%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: 'checkbox'}) do | quiz | %> -
+ Quizzes this user should be reviewing the results of.
+ Admins and Recruiters should not have any checked, unless they are expected
+ to participate in the technical review for that quiz.
+