dont show private maps in global collection (#734)

* dont show private maps in global collection

* Update explore_controller.rb

* Update main_controller.rb
This commit is contained in:
Connor Turland 2016-10-06 23:45:17 -04:00 committed by GitHub
parent 97d2868fad
commit 86a6e92bc3
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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