class UserPostView < ApplicationRecord self.primary_key = :user_id, :post_id belongs_to :user belongs_to :post validates :user_id, presence: true validates :post_id, presence: true end