debian-mirror-gitlab/app/models/board_project_recent_visit.rb
2023-03-04 22:38:38 +05:30

21 lines
483 B
Ruby

# frozen_string_literal: true
# Tracks which boards in a specific project a user has visited
class BoardProjectRecentVisit < ApplicationRecord
include BoardRecentVisit
belongs_to :user
belongs_to :project
belongs_to :board
validates :user, presence: true
validates :project, presence: true
validates :board, presence: true
scope :by_user_parent, ->(user, project) { where(user: user, project: project) }
def self.board_parent_relation
:project
end
end