debian-mirror-gitlab/app/models/board_project_recent_visit.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
484 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
# Tracks which boards in a specific project a user has visited
2019-07-07 11:18:12 +05:30
class BoardProjectRecentVisit < ApplicationRecord
2021-06-08 01:23:25 +05:30
include BoardRecentVisit
2018-12-13 13:39:08 +05:30
belongs_to :user
belongs_to :project
belongs_to :board
2021-06-08 01:23:25 +05:30
validates :user, presence: true
2018-12-13 13:39:08 +05:30
validates :project, presence: true
validates :board, presence: true
2021-06-08 01:23:25 +05:30
scope :by_user_parent, -> (user, project) { where(user: user, project: project) }
2019-07-07 11:18:12 +05:30
2021-06-08 01:23:25 +05:30
def self.board_parent_relation
:project
2018-12-13 13:39:08 +05:30
end
end