module Commentui::ActsAsCommentuiable

Public Instance Methods

acts_as_commentuiable() click to toggle source
# File lib/commentui/acts_as_commentuiable.rb, line 8
def acts_as_commentuiable
  class_exec do
    has_one :commentui_topic,
            dependent: :nullify,
            as: :commentable,
            class_name: "Commentui::Topic"

    def commentui_topic
      @commentui_topic ||= (super || create_commentui_topic)
    end
  end
end
commentui_topic() click to toggle source
Calls superclass method
# File lib/commentui/acts_as_commentuiable.rb, line 15
def commentui_topic
  @commentui_topic ||= (super || create_commentui_topic)
end