Sha256: f91a3b845d02d64660885718ff3e119fc062b906f573ed3ce1a8e2df4a17a514
Contents?: true
Size: 366 Bytes
Versions: 9
Compression:
Stored size: 366 Bytes
Contents
class ForumPost < ApplicationRecord belongs_to :forum_thread, counter_cache: true, touch: true belongs_to :user has_many :reactions, as: :reactable validates :user_id, :body, presence: true scope :sorted, ->{ order(:created_at) } after_update :solve_forum_thread, if: :solved? def solve_forum_thread forum_thread.update(solved: true) end end
Version data entries
9 entries across 9 versions & 1 rubygems