File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ class DashboardController < ApplicationController
44
55 def index
66 @org_stats = OrganizationStats . new ( current_organization )
7- @total_inventory = current_organization . total_inventory
87 @partners_awaiting_review = current_organization . partners . awaiting_review
9- @outstanding_requests = current_organization . ordered_requests . where ( status : %i[ pending started ] ) . order ( :created_at )
8+ @outstanding_requests = current_organization
9+ . ordered_requests
10+ . includes ( :partner_user , :partner )
11+ . where ( status : %i[ pending started ] )
12+ . order ( :created_at )
13+ . limit ( 25 )
1014
1115 @low_inventory_report = LowInventoryQuery . call ( current_organization )
1216
Original file line number Diff line number Diff line change 88 footer_options: { class: "text-center" },
99 ) do
1010%>
11- <% if @outstanding_requests.empty ? %>
11+ <% if @outstanding_requests.length.zero ? %>
1212 No outstanding requests!
1313 <% else %>
1414 <table class ="table table-hover striped ">
2121 </ tr >
2222 </ thead >
2323 < tbody >
24- <% @outstanding_requests . take ( 25 ) . each do |item | %>
24+ <% @outstanding_requests . each do |request | %>
2525 < tr >
26- < td class ="date "> <%= link_to item . created_at . strftime ( "%m/%d/%Y" ) , item %> </ td >
27- < td > <%= item . partner . name %> </ td >
28- < td > <%= item . partner_user &.formatted_email %> </ td >
29- < td > <%= item . comments %> </ td >
26+ < td class ="date "> <%= link_to request . created_at . strftime ( "%m/%d/%Y" ) , request %> </ td >
27+ < td > <%= request . partner . name %> </ td >
28+ < td > <%= request . partner_user &.formatted_email %> </ td >
29+ < td > <%= request . comments %> </ td >
3030 </ tr >
3131 <% end %>
3232 </ tbody >
You can’t perform that action at this time.
0 commit comments