c57f18c20c
The domain language is clearer if we just persist a thread. Also rename some models so their purpose is clear.
13 lines
270 B
Ruby
13 lines
270 B
Ruby
class Comment < ApplicationRecord
|
|
include Searchable, Threadable
|
|
|
|
belongs_to :bubble, touch: true
|
|
belongs_to :creator, class_name: "User", default: -> { Current.user }
|
|
|
|
searchable_by :body, using: :comments_search_index
|
|
|
|
def thread
|
|
bubble.thread
|
|
end
|
|
end
|