You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
490 B

  1. # frozen_string_literal: true
  2. module Streamable
  3. extend ActiveSupport::Concern
  4. included do
  5. has_one :stream_entry, as: :activity
  6. def title
  7. super
  8. end
  9. def content
  10. title
  11. end
  12. def target
  13. super
  14. end
  15. def object_type
  16. :activity
  17. end
  18. def thread
  19. super
  20. end
  21. def hidden?
  22. false
  23. end
  24. after_create do
  25. account.stream_entries.create!(activity: self, hidden: hidden?) if account.local?
  26. end
  27. end
  28. end