app/models/decidim/blogs/post.rb in decidim-blogs-0.24.3 vs app/models/decidim/blogs/post.rb in decidim-blogs-0.25.0.rc1

- old
+ new

@@ -8,11 +8,11 @@ include Decidim::Resourceable include Decidim::HasAttachments include Decidim::HasAttachmentCollections include Decidim::HasComponent include Decidim::Authorable - include Decidim::Comments::Commentable + include Decidim::Comments::CommentableWithComponent include Decidim::Searchable include Decidim::Endorsable include Decidim::Followable include Decidim::TranslatableResource include Traceable @@ -37,36 +37,26 @@ def visible? participatory_space.try(:visible?) && component.try(:published?) end - # Public: Overrides the `commentable?` Commentable concern method. - def commentable? - component.settings.comments_enabled? - end - - # Public: Overrides the `accepts_new_comments?` Commentable concern method. - def accepts_new_comments? - commentable? && !component.current_settings.comments_blocked - end - # Public: Overrides the `comments_have_alignment?` Commentable concern method. def comments_have_alignment? true end # Public: Overrides the `comments_have_votes?` Commentable concern method. def comments_have_votes? true end - def official? - author.nil? + # Public: Overrides the `allow_resource_permissions?` Resourceable concern method. + def allow_resource_permissions? + true end - # Public: Whether the object can have new comments or not. - def user_allowed_to_comment?(user) - can_participate_in_space?(user) + def official? + author.nil? end def users_to_notify_on_comment_created followers end