class WatchVideoHistory < ApplicationRecord belongs_to :user belongs_to :video belongs_to :watch_course_video, optional: true validates :duration, numericality: { greater_than_or_equal_to: 0 } end