From dd02d221d48a453ac5853ce910ec0c1afa70bc12 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 20 Jun 2016 08:24:29 +0800 Subject: [PATCH] skip policy scope if redirecting an explore page --- app/controllers/maps_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index b3de8100..1beb0054 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -39,7 +39,10 @@ class MapsController < ApplicationController # GET /explore/mine def mymaps - return redirect_to explore_active_path if !authenticated? + if !authenticated? + skip_policy_scope + return redirect_to explore_active_path + end page = params[:page].present? ? params[:page] : 1 @maps = policy_scope( @@ -54,7 +57,10 @@ class MapsController < ApplicationController # GET /explore/shared def sharedmaps - return redirect_to activemaps_url if !authenticated? + if !authenticated? + skip_policy_scope + return redirect_to activemaps_url + end page = params[:page].present? ? params[:page] : 1 @maps = policy_scope(