diff options
Diffstat (limited to 'app/models/concerns/streamable.rb')
-rw-r--r-- | app/models/concerns/streamable.rb | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/app/models/concerns/streamable.rb b/app/models/concerns/streamable.rb index 910736dac..7c9edb8ef 100644 --- a/app/models/concerns/streamable.rb +++ b/app/models/concerns/streamable.rb @@ -6,36 +6,38 @@ module Streamable included do has_one :stream_entry, as: :activity - def title - super + after_create do + account.stream_entries.create!(activity: self, hidden: hidden?) if needs_stream_entry? end + end - def content - title - end + def title + super + end - def target - super - end + def content + title + end - def object_type - :activity - end + def target + super + end - def thread - super - end + def object_type + :activity + end - def hidden? - false - end + def thread + super + end - def needs_stream_entry? - account.local? - end + def hidden? + false + end - after_create do - account.stream_entries.create!(activity: self, hidden: hidden?) if needs_stream_entry? - end + private + + def needs_stream_entry? + account.local? end end |