Skip to content

Commit

Permalink
Added activity tracking for background check exemption
Browse files Browse the repository at this point in the history
  • Loading branch information
viviancan committed Sep 30, 2024
1 parent 2484656 commit 817f16e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions app/controllers/admin/background_check_exemptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ def grant
@account = Account.find(params[:participant_id])

if @account.grant_background_check_exemption
@account.create_activity(
key: "account.update",
owner: current_account,
params: {
changes:
{background_check_exemption: @account.saved_change_to_background_check_exemption}
}
)
redirect_to admin_participant_path(@account),
success: "Background check exemption granted"
else
Expand All @@ -16,6 +24,14 @@ def revoke
@account = Account.find(params[:participant_id])

if @account.revoke_background_check_exemption
@account.create_activity(
key: "account.update",
owner: current_account,
params: {
changes:
{background_check_exemption: @account.saved_change_to_background_check_exemption}
}
)
redirect_to admin_participant_path(@account),
success: "Background check exemption revoked"
else
Expand Down
4 changes: 2 additions & 2 deletions app/views/public_activity/account/_update.en.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<li><%= t(key) %></li>

<ul style="list-style: circle;">
<li><%= changes.first %></li>
<li><%= changes.last %></li>
<li>Old: <%= changes.first %></li>
<li>New: <%= changes.last %></li>
</ul>
<% end %>
<% else %>
Expand Down

0 comments on commit 817f16e

Please sign in to comment.