From d319b2ff53ceb88b587402b544a6fa4b302b373e Mon Sep 17 00:00:00 2001 From: Gal Bracha Date: Wed, 11 Jan 2017 00:24:46 +0200 Subject: [PATCH 1/2] Random button now shows also for the dreamers dream. Random is not showing private and inactive dreams --- app/views/camps/show.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/camps/show.html.erb b/app/views/camps/show.html.erb index f61eaca3..d1fbb7aa 100644 --- a/app/views/camps/show.html.erb +++ b/app/views/camps/show.html.erb @@ -384,12 +384,12 @@
<% end %> - <% if !current_user || @camp.creator != current_user %> - <% random = Camp.order("RANDOM()").first %> - - <%=t :next_random_dream %> - - <% end %> + + <% random = Camp.where(active:true, is_public:true).order("RANDOM()").first %> + + <%=t :next_random_dream %> + + From 0af7cfaf33dec7439c65ffef4bea1e38701a5ef9 Mon Sep 17 00:00:00 2001 From: Elisha Date: Wed, 11 Jan 2017 08:02:31 +0200 Subject: [PATCH 2/2] Update show.html.erb --- app/views/camps/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/camps/show.html.erb b/app/views/camps/show.html.erb index d1fbb7aa..7cf73e97 100644 --- a/app/views/camps/show.html.erb +++ b/app/views/camps/show.html.erb @@ -385,7 +385,7 @@ <% end %> - <% random = Camp.where(active:true, is_public:true).order("RANDOM()").first %> + <% random = Camp.active(true).not_hidden(true).order("RANDOM()").first %> <%=t :next_random_dream %>