Welcome to mirror list, hosted at ThFree Co, Russian Federation.

board_group_recent_visit.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dc273e256a82adebd5f3dfd290d7aeb8e2b0e175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

# Tracks which boards in a specific group a user has visited
class BoardGroupRecentVisit < ApplicationRecord
  include BoardRecentVisit

  belongs_to :user
  belongs_to :group
  belongs_to :board

  validates :user, presence: true
  validates :group, presence: true
  validates :board, presence: true

  scope :by_user_parent, -> (user, group) { where(user: user, group: group) }

  def self.board_parent_relation
    :group
  end
end