From e3e15a1ef2b74951664084aa84242cc965399a84 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 19 Dec 2014 17:53:24 +0800 Subject: [PATCH] fix for all members --- app/controllers/pages_controller.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 9f3c149..48ef10f 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -76,10 +76,14 @@ class PagesController < ApplicationController params[:url] = page.url categories = [] if page.module == "member" - page.categories.each do |c| - category = Role.find(c) rescue nil - if !category.nil? && !category.disabled - categories << c + if page.categories.first == "all" + categories = ["all"] + else + page.categories.each do |c| + category = Role.find(c) rescue nil + if !category.nil? && !category.disabled + categories << c + end end end else