diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-07-14 21:18:37 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-07-19 17:15:10 +0200 |
commit | d26bc1536bb34cab8c425784d594fc723f6cf504 (patch) | |
tree | bccc65e27bfa2d2699d9806b10762ad7504be5d5 /app | |
parent | Feature covering reference answers and fixes needed to pass them (diff) | |
download | recruiting-webapp-d26bc1536bb34cab8c425784d594fc723f6cf504.tar.gz recruiting-webapp-d26bc1536bb34cab8c425784d594fc723f6cf504.tar.bz2 recruiting-webapp-d26bc1536bb34cab8c425784d594fc723f6cf504.zip |
Feature covering mentor approval for answers and necessary fixes
Diffstat (limited to 'app')
-rw-r--r-- | app/models/answer.rb | 4 | ||||
-rw-r--r-- | app/views/taglibs/detailed.dryml | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/answer.rb b/app/models/answer.rb index 43ce232..8709c17 100644 --- a/app/models/answer.rb +++ b/app/models/answer.rb @@ -27,9 +27,11 @@ class Answer < ActiveRecord::Base after_update :notify_changed_answer multi_permission :update, :destroy do + # It's fine to change correct, because it's ignored in non-email answers + # and email answers have separate permissions (owned? && !reference && !approved) || (reference && acting_user.role.is_recruiter?) || - (only_changed?(:approved) && owner.mentor_is?(acting_user)) + (only_changed?(:approved, :correct) && owner.mentor_is?(acting_user)) end def create_permitted? diff --git a/app/views/taglibs/detailed.dryml b/app/views/taglibs/detailed.dryml index 3ff9792..690126a 100644 --- a/app/views/taglibs/detailed.dryml +++ b/app/views/taglibs/detailed.dryml @@ -23,6 +23,8 @@ <with:question><view:content/></with> <h5>Answer:</h5> + <if:approved>Approved</if> + <else:approved>Not approved</else> <view:content/> </def> |