class Post < ApplicationRecord belongs_to :thread, class_name: 'Topic', foreign_key: :thread_id has_one_attached :image has_secure_password validations: false scope :active, -> { where deleted_at: nil } end