闭社主体 forked from https://github.com/tootsuite/mastodon
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.

31 lines
405 B

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