Skip to content

Instantly share code, notes, and snippets.

@milushov
Created February 24, 2014 12:31
Show Gist options
  • Save milushov/9187542 to your computer and use it in GitHub Desktop.
Save milushov/9187542 to your computer and use it in GitHub Desktop.
module Commentable
extend ActiveSupport::Concern
included do
include TheComments::Commentable
# Denormalization methods. Please, read about advanced using
def commentable_title
title.blank? ? "Undefined title" : title
end
def commentable_url
['', self.class.to_s.tableize, id].join('/')
end
def commentable_state
state
end unless self.new.kind_of? Topic
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment