-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #81 Solutions "not ready" info buried too deep #134
Conversation
@@ -17,6 +17,12 @@ | |||
<div class="quad-question"> | |||
|
|||
<% if @question.errors.none? %> | |||
<% @question.solutions.each do |solution| %> | |||
<% if solution.is_visible == false && present_user == solution.creator %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this loop. Can you change this to
if !@question.solutions.where{(is_visible == false) & (creator == my{present_user})}.first.nil?
and then remove the loop? (might need to pull upstream/master if squeel is not installed)
Actually, do this in the controller and pass this as a variable, e.g.
@unfinished_solutions = !@question.solutions.where{(is_visible == false) & (creator == my{present_user})}.first.nil?
And then in the view:
<% if @unfinished_solutions %>
etc
@Dantemss Updated the pull request. Should be ready to go? |
@jpslav should be good to pull |
Issue #81 Solutions "not ready" info buried too deep
Thanks @dtreiter! |
Now a yellow notice appears to the user who wrote an solution which is 'not ready to be viewed'. It is displayed on the question show page and the solutions page.