aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/question.rb')
-rw-r--r--app/models/question.rb3
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?