made privacy_allow_stranger_answers work
This commit is contained in:
parent
cdfe5564d6
commit
59b431513b
|
@ -18,6 +18,13 @@ class Ajax::AnswerController < ApplicationController
|
|||
end
|
||||
else
|
||||
question = Question.find(params[:id])
|
||||
|
||||
unless question.user.privacy_allow_stranger_answers
|
||||
@status = :privacy_stronk
|
||||
@message = "This user does not want other users to answer their question."
|
||||
@success = false
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
answer = nil
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @answers.current_page }}
|
||||
Load more
|
||||
|
||||
- if user_signed_in? and !current_user.answered? @question and current_user != @question.user
|
||||
- if user_signed_in? and !current_user.answered? @question and current_user != @question.user and @question.user.privacy_allow_stranger_answers
|
||||
.panel.panel-default#q-answer-box
|
||||
.panel-heading
|
||||
%h3.panel-title This question was not in your inbox? Answer it here!
|
||||
|
|
Loading…
Reference in New Issue