Skip to content

Commit

Permalink
Add success? method to ProjectAllocation and update view logic for al…
Browse files Browse the repository at this point in the history
…location status
  • Loading branch information
andrew committed Feb 27, 2025
1 parent 35f1430 commit 6a70af9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/models/project_allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,12 @@ def find_transaction
end

def status
return 'REJECTED' if funding_rejected?
return invitation.status if invitation.present?
return 'PAID' if find_transaction.present?
end

def success?
['APPROVED', 'PAID'].include?(status)
end
end
2 changes: 1 addition & 1 deletion app/views/funds/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<tbody>
<% @project_allocations.each_with_index do |project_allocation, i| %>
<% next if project_allocation.project_url.nil? %>
<% next if @allocation.completed? && !project_allocation.paid? %>
<% next if @allocation.completed? && !project_allocation.success? %>

<!-- Main Row -->
<tr class="clickable-row <%= 'row-rejected' if project_allocation.project_funding_rejected %>" data-bs-toggle="collapse" data-bs-target="#details-<%= i %>" role="button" aria-controls="#details-<%= i %>">
Expand Down

0 comments on commit 6a70af9

Please sign in to comment.