c57f18c20c
The domain language is clearer if we just persist a thread. Also rename some models so their purpose is clear.
12 lines
323 B
Ruby
12 lines
323 B
Ruby
class Bubble::Thread::Entry < ApplicationRecord
|
|
belongs_to :thread, touch: true
|
|
|
|
delegated_type :threadable, types: Threadable::TYPES, inverse_of: :thread_entry, dependent: :destroy
|
|
|
|
scope :chronologically, -> { order created_at: :asc, id: :desc }
|
|
|
|
def to_partial_path
|
|
"bubbles/threads/entries/entry"
|
|
end
|
|
end
|