Skip to content

Commit 30e9049

Browse files
Disable send grant button according to card grant policy (#12152)
## Summary of the problem <!-- Why are these changes being made? What problem does it solve? Link any related issues to provide more details. --> Currently, the send grant button on the new card grants overview page checks the transfer create policy for if it is disabled. However, this policy differs from the card grant create policy because it does not check if the event plan has card grants enabled. ## Describe your changes <!-- Explain your thought process to the solution and provide a quick summary of the changes. --> Changes the disabled attribute on the send grant button to check the card grant policy instead of the transfer create policy. <!-- If there are any visual changes, please attach images, videos, or gifs. --> Co-authored-by: Luke Oldenburg <[email protected]>
1 parent 3924801 commit 30e9049

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/card_grants/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<% if organizer_signed_in?(as: :member) %>
1212
<%= render "card_grants/create_modal" %>
13-
<%= link_to new_event_card_grant_path(@event), class: "btn bg-success", data: { behavior: "modal_trigger", modal: "create_card_grant" }, disabled: !policy(@event).create_transfer? do %>
13+
<%= link_to new_event_card_grant_path(@event), class: "btn bg-success", data: { behavior: "modal_trigger", modal: "create_card_grant" }, disabled: !policy(@event.card_grants.build).create? do %>
1414
<%= inline_icon "card-add" %>
1515
Send a grant
1616
<% end %>

0 commit comments

Comments
 (0)