Include nested objects in database queries of Finance::BaseController

This commit is contained in:
Patrick Gansterer 2017-10-02 16:05:18 +02:00
parent 09548574cb
commit 8fe633fc42

View file

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