Class: Decidim::Blogs::Post
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Blogs::Post
- Includes:
- Authorable, Comments::Commentable, HasComponent, Resourceable, Loggable, Traceable
- Defined in:
- app/models/decidim/blogs/post.rb
Overview
The data store for a Blog in the Decidim::Blogs component. It stores a title, description and any other useful information to render a blog.
Instance Method Summary collapse
-
#accepts_new_comments? ⇒ Boolean
Public: Overrides the ‘accepts_new_comments?` Commentable concern method.
-
#commentable? ⇒ Boolean
Public: Overrides the ‘commentable?` Commentable concern method.
-
#comments_have_alignment? ⇒ Boolean
Public: Overrides the ‘comments_have_alignment?` Commentable concern method.
-
#comments_have_votes? ⇒ Boolean
Public: Overrides the ‘comments_have_votes?` Commentable concern method.
- #official? ⇒ Boolean
Instance Method Details
#accepts_new_comments? ⇒ Boolean
Public: Overrides the ‘accepts_new_comments?` Commentable concern method.
27 28 29 |
# File 'app/models/decidim/blogs/post.rb', line 27 def accepts_new_comments? commentable? && !component.current_settings.comments_blocked end |
#commentable? ⇒ Boolean
Public: Overrides the ‘commentable?` Commentable concern method.
22 23 24 |
# File 'app/models/decidim/blogs/post.rb', line 22 def commentable? component.settings.comments_enabled? end |
#comments_have_alignment? ⇒ Boolean
Public: Overrides the ‘comments_have_alignment?` Commentable concern method.
32 33 34 |
# File 'app/models/decidim/blogs/post.rb', line 32 def comments_have_alignment? true end |
#comments_have_votes? ⇒ Boolean
Public: Overrides the ‘comments_have_votes?` Commentable concern method.
37 38 39 |
# File 'app/models/decidim/blogs/post.rb', line 37 def comments_have_votes? true end |
#official? ⇒ Boolean
41 42 43 |
# File 'app/models/decidim/blogs/post.rb', line 41 def official? .nil? end |