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

21 lines
466 B
Ruby
Raw Normal View History

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