diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-07-15 15:28:55 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-07-21 20:49:50 +0200 |
commit | c097a6cac078137eecbf675d8c2da7ab7b3b1e3a (patch) | |
tree | 87f8eb7f1a7a95a9674e44d9298a4b600fcad320 /app/models | |
parent | Feature covering proper view of questions by category (diff) | |
download | recruiting-webapp-c097a6cac078137eecbf675d8c2da7ab7b3b1e3a.tar.gz recruiting-webapp-c097a6cac078137eecbf675d8c2da7ab7b3b1e3a.tar.bz2 recruiting-webapp-c097a6cac078137eecbf675d8c2da7ab7b3b1e3a.zip |
Cleaned question creation a bit
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/question.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/question.rb b/app/models/question.rb index d5e1d8a..da122c3 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -40,6 +40,9 @@ class Question < ActiveRecord::Base end def view_permitted?(field) + # Don't allow viewing some fields on creation + return false if new_record? && [:user, :approved].include?(field) + # Unapproved questions can be seen only by recruiters and owner if !approved return user_is?(acting_user) || acting_user.try.role.try.is_recruiter? |