c57f18c20c
The domain language is clearer if we just persist a thread. Also rename some models so their purpose is clear.
10 lines
234 B
Ruby
10 lines
234 B
Ruby
module Bubble::Commentable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
has_many :comments, dependent: :destroy
|
|
|
|
scope :ordered_by_comments, -> { left_joins(:comments).group(:id).order("COUNT(comments.id) DESC") }
|
|
end
|
|
end
|