Added some eager loading for balancing new.
This commit is contained in:
parent
40d9195eac
commit
6196bdae41
3 changed files with 6 additions and 4 deletions
|
|
@ -21,8 +21,10 @@ class Finance::BalancingController < Finance::BaseController
|
|||
sort = "id"
|
||||
end
|
||||
|
||||
@articles = @order.order_articles.ordered.includes(:article).order(sort)
|
||||
|
||||
@articles = @order.order_articles.ordered.includes(:order, :article, :article_price,
|
||||
group_order_articles: {group_order: :ordergroup}).order(sort)
|
||||
|
||||
|
||||
if params[:sort] == "order_number"
|
||||
@articles = @articles.to_a.sort { |a,b| a.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> b.article.order_number.gsub(/[^[:digit:]]/, "").to_i }
|
||||
elsif params[:sort] == "order_number_reverse"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue