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

Version Path
my_forum-0.0.1.beta8 app/controllers/my_forum/welcome_controller.rb
my_forum-0.0.1.beta7 app/controllers/my_forum/welcome_controller.rb
my_forum-0.0.1.beta5 app/controllers/my_forum/welcome_controller.rb
my_forum-0.0.1.beta4 app/controllers/my_forum/welcome_controller.rb
my_forum-0.0.1.beta3 app/controllers/my_forum/welcome_controller.rb
my_forum-0.0.1.beta2 app/controllers/my_forum/welcome_controller.rb
my_forum-0.0.1.beta1 app/controllers/my_forum/welcome_controller.rb