Sha256: 481d40016eac3079f68cf4ffe4d0cb0673555a7f783a96c087a1ed6ad77645f1

Contents?: true

Size: 389 Bytes

Versions: 16

Compression:

Stored size: 389 Bytes

Contents

class ForumCategory < Category

  has_many     :forums, :dependent => :destroy

  # Are any of the forums readable by this user? One positive is all need...
  #------------------------------------------------------------------------------
  def any_readable_forums?(user)
    if user && user.is_admin?
      true
    else
      forums.any? { |f| f.can_be_read_by?(user) }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_forum-4.2.3.10 app/models/forum_category.rb
dm_forum-4.2.3.9 app/models/forum_category.rb
dm_forum-4.2.3.8 app/models/forum_category.rb
dm_forum-4.2.3.7 app/models/forum_category.rb
dm_forum-4.2.3.6 app/models/forum_category.rb
dm_forum-4.2.3.5 app/models/forum_category.rb
dm_forum-4.2.3.4 app/models/forum_category.rb
dm_forum-4.2.3.3 app/models/forum_category.rb
dm_forum-4.2.3.2 app/models/forum_category.rb
dm_forum-4.2.3.1 app/models/forum_category.rb
dm_forum-4.2.3 app/models/forum_category.rb
dm_forum-4.2.2.3 app/models/forum_category.rb
dm_forum-4.2.2.2 app/models/forum_category.rb
dm_forum-4.2.2.1 app/models/forum_category.rb
dm_forum-4.2.2 app/models/forum_category.rb
dm_forum-4.2.1.5 app/models/forum_category.rb