Fixed missing scoping by ordergroup in financial index.

This commit is contained in:
benni 2012-12-22 14:23:58 +01:00
parent 1298af8377
commit 807d476e44

View file

@ -19,10 +19,11 @@ class Finance::FinancialTransactionsController < ApplicationController
sort = "created_on DESC" sort = "created_on DESC"
end end
@financial_transactions = @ordergroup.financial_transactions.unscoped.order(sort) @financial_transactions = @ordergroup.financial_transactions.includes(:user).order(sort).
@financial_transactions = @financial_transactions.where('note LIKE ?', "%#{params[:query]}%") unless params[:query].nil? page(params[:page]).per(@per_page)
if params[:query].present?
@financial_transactions = @financial_transactions.page(params[:page]).per(@per_page) @financial_transactions = @financial_transactions.where('note LIKE ?', "%#{params[:query]}%")
end
end end
def new def new