Sha256: ec87ca89c27a96985baab05f59487615436db8d117c80d1f5befc139252cfd53
Contents?: true
Size: 376 Bytes
Versions: 9
Compression:
Stored size: 376 Bytes
Contents
class SupportPost < ApplicationRecord belongs_to :support_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_support_thread, if: :solved? def solve_support_thread support_thread.update(solved: true) end end
Version data entries
9 entries across 9 versions & 1 rubygems