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.

33 lines
436 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. after_create do
  22. account.stream_entries.create!(activity: self) if account.local?
  23. end
  24. end
  25. end