blob: d61cdea5354a8982a018673f713e7fd847da9c98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# frozen_string_literal: true
# Extend the ProjectMember & GroupMember class with the ability to
# to run project_authorizations refresh jobs inline.
# This is needed so that calls like `group.add_member(user, access_level)` or `create(:project_member)`
# in the specs can be run without including `:sidekiq_inline` trait.
module StubbedMember
extend ActiveSupport::Concern
module Member
private
def refresh_member_authorized_projects
AuthorizedProjectsWorker.new.perform(user_id)
end
end
module ProjectMember
private
def execute_project_authorizations_refresh
AuthorizedProjectUpdate::ProjectRecalculatePerUserWorker.new.perform(project.id, user.id)
end
end
end
|