Created
February 24, 2014 12:31
-
-
Save milushov/9187542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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