Sha256: 5d33cbccfd3d7474a01dfa3c4ed5f0ee9d04c0bc5a5f2c7496e683ca95ce03b9

Contents?: true

Size: 855 Bytes

Versions: 16

Compression:

Stored size: 855 Bytes

Contents

class ForumSite < ActiveRecord::Base
  class UndefinedError < StandardError; end

  self.table_name           = 'fms_forum_sites'

  has_many                  :forums,         -> { where(is_public: true) }
  has_many                  :all_forums,     :class_name => 'Forum'
  has_many                  :forum_topics,   :through => :forums
  has_many                  :forum_comments, :through => :forums

  default_scope             { where(account_id: Account.current.id) }

  attr_readonly             :comments_count, :forum_topics_count, :users_online


  # There is only one forum site per account
  #------------------------------------------------------------------------------
  def self.site
    ForumSite.first
  end
  
  #------------------------------------------------------------------------------
  def ordered_forums
    forums
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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