diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-11 09:10:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-11 09:10:29 +0300 |
commit | b7eed2ea49477a8baa7d9b0cf8034c799cde2e0f (patch) | |
tree | 38df0de2d4c7344a07d55f7cf5914344ba88e8e6 /app/models/concerns/board_recent_visit.rb | |
parent | 11bfe6f3835256acf60ef98f9e2a37f417418681 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/board_recent_visit.rb')
-rw-r--r-- | app/models/concerns/board_recent_visit.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/app/models/concerns/board_recent_visit.rb b/app/models/concerns/board_recent_visit.rb deleted file mode 100644 index fd4d574ac58..00000000000 --- a/app/models/concerns/board_recent_visit.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module BoardRecentVisit - extend ActiveSupport::Concern - - class_methods do - def visited!(user, board) - find_or_create_by( - "user" => user, - board_parent_relation => board.resource_parent, - board_relation => board - ).tap do |visit| - visit.touch - end - rescue ActiveRecord::RecordNotUnique - retry - end - - def latest(user, parent, count: nil) - visits = by_user_parent(user, parent).order(updated_at: :desc) - visits = visits.preload(board_relation) - - visits.first(count) - end - - def board_relation - :board - end - - def board_parent_relation - raise NotImplementedError - end - end -end |