diaspora/lib/stream/local_public.rb
2021-04-18 13:25:50 +02:00

27 lines
575 B
Ruby

# frozen_string_literal: true
# rubocop:disable Style/ClassAndModuleChildren
class Stream::LocalPublic < Stream::Base
def link(opts={})
Rails.application.routes.url_helpers.local_public_stream_path(opts)
end
def title
I18n.t("streams.local_public.title")
end
# @return [ActiveRecord::Association<Post>] AR association of posts
def posts
@posts ||= Post.all_local_public
end
def can_comment?(post)
post.author.local?
end
# Override base class method
def aspects
["public"]
end
end
# rubocop:enable Style/ClassAndModuleChildren