Sha256: 699158d06ff79fee041d06c86fc50711a8c26fa02e1d166abce7e1faf4b2cbbb
Contents?: true
Size: 835 Bytes
Versions: 11
Compression:
Stored size: 835 Bytes
Contents
module CamaleonCms class PostCommentDecorator < Draper::Decorator delegate_all # return created at date formatted def the_created_at(format = :long) h.l(object.created_at, format: format.to_sym) end # return owner of this comment def the_user object.user.decorate end alias the_author the_user def the_post object.post.decorate end def the_content object.content end def the_answers object.children.approveds end def the_author_name object.author.presence || object.user.full_name end def the_author_email object.author_email.presence || object.user.email end def the_author_url object.author_url.presence || (object.user.username == 'anonymous' ? '' : object.user.decorate.the_url) end end end
Version data entries
11 entries across 11 versions & 1 rubygems