fixed member categories all problem

This commit is contained in:
Harry Bomrah 2014-12-19 16:33:23 +08:00
parent e21ad257ff
commit 2402f953f0
1 changed files with 13 additions and 4 deletions

View File

@ -75,10 +75,19 @@ class PagesController < ApplicationController
end end
params[:url] = page.url params[:url] = page.url
categories = [] categories = []
page.categories.each do |c| if page.module == "member"
category = Category.find(c) rescue nil page.categories.each do |c|
if !category.nil? && !category.disable category = Role.find(c) rescue nil
categories << c if !category.nil? && !category.disabled
categories << c
end
end
else
page.categories.each do |c|
category = Category.find(c) rescue nil
if !category.nil? && !category.disable
categories << c
end
end end
end end
categories = ["all"] if categories.blank? categories = ["all"] if categories.blank?