Skip to content
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

Merged
merged 9 commits into from
Jul 20, 2012

Conversation

dtreiter
Copy link

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.

@@ -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 %>
Copy link
Member

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

@dtreiter
Copy link
Author

@Dantemss Updated the pull request. Should be ready to go?

@Dantemss
Copy link
Member

@jpslav should be good to pull

jpslav added a commit that referenced this pull request Jul 20, 2012
Issue #81 Solutions "not ready" info buried too deep
@jpslav jpslav merged commit e064da1 into lml:master Jul 20, 2012
@jpslav
Copy link
Member

jpslav commented Jul 20, 2012

Thanks @dtreiter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants