Include nested objects in database queries of Finance::BaseController
This commit is contained in:
parent
09548574cb
commit
8fe633fc42
1 changed files with 4 additions and 4 deletions
|
@ -2,9 +2,9 @@ class Finance::BaseController < ApplicationController
|
||||||
before_filter :authenticate_finance
|
before_filter :authenticate_finance
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@financial_transactions = FinancialTransaction.order('created_on DESC').limit(8)
|
@financial_transactions = FinancialTransaction.includes(:ordergroup).order('created_on DESC').limit(8)
|
||||||
@orders = Order.finished_not_closed
|
@orders = Order.finished_not_closed.includes(:supplier)
|
||||||
@unpaid_invoices = Invoice.unpaid
|
@unpaid_invoices = Invoice.unpaid.includes(:supplier)
|
||||||
|
|
||||||
render template: 'finance/index'
|
render template: 'finance/index'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue