class Update < ApplicationRecord include Recordable belongs_to :stream validates :stream, :body, presence: true after_create :set_latest_timestamp def path "/thinks/#{stream.slug}\#update-#{id}" end def taggable stream end private def set_latest_timestamp self.stream.latest_post_at = self.created_at self.stream.save! end end