Module: Extensions::DiscussionTopic::ActiveRecord::Base::ClassMethods

Defined in:
lib/extensions/discussion_topic/active_record/base.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_discussion_topic(display_globally: false, touch: false) ⇒ Object

Declare this in model, for it to support discussions.

comments center.

Parameters:

  • options (Hash)

    a customizable set of options


9
10
11
12
13
14
# File 'lib/extensions/discussion_topic/active_record/base.rb', line 9

def acts_as_discussion_topic(display_globally: false, touch: false)
  acts_as :discussion_topic, class_name: Course::Discussion::Topic.name, touch: touch
  # For autoload to work correctly after class changed, we store the model name first and
  # constantize later.
  Course::Discussion::Topic.global_topic_model_names << name if display_globally
end