Files
fizzy/app/models/bubble/thread.rb
T
Jose Farias c57f18c20c Materialize abstract thread
The domain language is clearer if we just persist a thread. Also rename some models so their purpose is clear.
2024-10-24 17:36:14 -06:00

14 lines
296 B
Ruby

class Bubble::Thread < ApplicationRecord
belongs_to :bubble, touch: true
has_many :entries, -> { chronologically }, dependent: :destroy
def latest_rollup
entries.last&.event_rollup || Event::Rollup.new(thread: self)
end
def to_partial_path
"bubbles/threads/thread"
end
end