Sha256: 2c0c06125eeaa621ba1406a388c007344468dc9f3b3213045cc5fd52e332d9f6
Contents?: true
Size: 418 Bytes
Versions: 7
Compression:
Stored size: 418 Bytes
Contents
require_dependency "my_forum/application_controller" module MyForum class WelcomeController < ApplicationController def index return @forum_categories = Category.includes(:forums) if current_user && current_user.is_admin? @forum_categories = Category.includes(:forums, :user_groups). reject{|category| (category.user_groups.map(&:name) & (current_user_groups)).blank? } end end end
Version data entries
7 entries across 7 versions & 1 rubygems