Module: EnginesExtensions

Defined in:
lib/community_engine/engines_extensions.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_moderated_commentableObject



7
8
9
10
11
12
13
14
# File 'lib/community_engine/engines_extensions.rb', line 7

def acts_as_moderated_commentable
  acts_as_commentable :published, :pending
  has_many :comments, -> { where "role != 'pending'"}, {
    :as => :commentable,
    :dependent => :destroy,
    :before_add => Proc.new { |x, c| c.role = 'published' }
  }
end

#require_from_ce(path) ⇒ Object



3
4
5
# File 'lib/community_engine/engines_extensions.rb', line 3

def require_from_ce(path)
  require_dependency CommunityEngine::Engine.config.root.join('app', path).to_s
end