From c0f89e6010d32495f37139c4abdf455ec082e523 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 6 Oct 2016 11:22:09 -0400 Subject: [PATCH] dont show private maps in global collection --- app/controllers/explore_controller.rb | 2 +- app/controllers/main_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/explore_controller.rb b/app/controllers/explore_controller.rb index dc4c2de9..c6897047 100644 --- a/app/controllers/explore_controller.rb +++ b/app/controllers/explore_controller.rb @@ -9,7 +9,7 @@ class ExploreController < ApplicationController # GET /explore/active def active - @maps = map_scope(Map.where.not(name: 'Untitled Map')) + @maps = map_scope(Map.where.not(name: 'Untitled Map').where.not(permission: 'Private')) respond_to do |format| format.html do diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 7df4e366..6350b9b5 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -8,7 +8,7 @@ class MainController < ApplicationController respond_to do |format| format.html do if authenticated? - @maps = policy_scope(Map).where.not(name: 'Untitled Map') + @maps = policy_scope(Map).where.not(name: 'Untitled Map').where.not(permission: 'Private') .order(updated_at: :desc).page(1).per(20) render 'explore/active' else