Class: CamaleonCms::PostCommentDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- CamaleonCms::PostCommentDecorator
- Defined in:
- app/decorators/camaleon_cms/post_comment_decorator.rb
Instance Method Summary collapse
- #the_answers ⇒ Object
- #the_author_email ⇒ Object
- #the_author_name ⇒ Object
- #the_author_url ⇒ Object
- #the_content ⇒ Object
-
#the_created_at(format = :long) ⇒ Object
return created at date formatted.
- #the_post ⇒ Object
-
#the_user ⇒ Object
(also: #the_author)
return owner of this comment.
Instance Method Details
#the_answers ⇒ Object
23 24 25 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 23 def the_answers object.children.approveds end |
#the_author_email ⇒ Object
31 32 33 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 31 def object..presence || object.user.email end |
#the_author_name ⇒ Object
27 28 29 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 27 def object..presence || object.user.full_name end |
#the_author_url ⇒ Object
35 36 37 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 35 def object..presence || (object.user.username == 'anonymous' ? '' : object.user.decorate.the_url) end |
#the_content ⇒ Object
19 20 21 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 19 def the_content object.content end |
#the_created_at(format = :long) ⇒ Object
return created at date formatted
5 6 7 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 5 def the_created_at(format = :long) h.l(object.created_at, format: format.to_sym) end |
#the_post ⇒ Object
15 16 17 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 15 def the_post object.post.decorate end |
#the_user ⇒ Object Also known as:
return owner of this comment
10 11 12 |
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 10 def the_user object.user.decorate end |