class WikiAsset < ApplicationRecord self.primary_key = :wiki_page_id, :no belongs_to :wiki_page belongs_to :created_by_user, class_name: 'User' has_one_attached :file validates :file, presence: true end