app/models/decidim/blogs/post.rb in decidim-blogs-0.26.10 vs app/models/decidim/blogs/post.rb in decidim-blogs-0.27.0.rc1
- old
+ new
@@ -12,11 +12,10 @@
include Decidim::Authorable
include Decidim::Comments::CommentableWithComponent
include Decidim::Searchable
include Decidim::Endorsable
include Decidim::Followable
- include Decidim::Reportable
include Decidim::TranslatableResource
include Traceable
include Loggable
component_manifest_name "blogs"
@@ -38,10 +37,14 @@
def visible?
participatory_space.try(:visible?) && component.try(:published?)
end
+ def self.log_presenter_class_for(_log)
+ Decidim::Blogs::AdminLog::PostPresenter
+ end
+
# Public: Overrides the `comments_have_alignment?` Commentable concern method.
def comments_have_alignment?
true
end
@@ -54,33 +57,22 @@
def allow_resource_permissions?
true
end
def official?
- author.nil?
+ author.is_a?(Decidim::Organization)
end
+ def user_group?
+ author.is_a?(Decidim::UserGroup)
+ end
+
def users_to_notify_on_comment_created
followers
end
def attachment_context
:admin
- end
-
- # Public: Overrides the `reported_content_url` Reportable concern method.
- def reported_content_url
- ResourceLocatorPresenter.new(self).url
- end
-
- # Public: Overrides the `reported_attributes` Reportable concern method.
- def reported_attributes
- [:title, :body]
- end
-
- # Public: Overrides the `reported_searchable_content_extras` Reportable concern method.
- def reported_searchable_content_extras
- [normalized_author.name]
end
end
end
end