Limit financial overview items to speed up loading

If a foodcoop does not use the balancing feature the list of unfinished
orders will be very long and needs a significant amount of time to load.
This commit is contained in:
Patrick Gansterer 2019-11-19 16:50:02 +01:00
parent b45e48e4c9
commit 3fb3fa409b

View file

@ -3,8 +3,8 @@ class Finance::BaseController < ApplicationController
def index
@financial_transactions = FinancialTransaction.includes(:ordergroup).order('created_on DESC').limit(8)
@orders = Order.finished_not_closed.includes(:supplier)
@unpaid_invoices = Invoice.unpaid.includes(:supplier)
@orders = Order.finished_not_closed.includes(:supplier).limit(8)
@unpaid_invoices = Invoice.unpaid.includes(:supplier).limit(8)
render template: 'finance/index'
end