Removed article from includes in as it does not work with acts_as_paranoid.

See also https://github.com/goncalossilva/rails3_acts_as_paranoid/issues/62.
Better we remove acts_as_paranoid and filter manually?
This commit is contained in:
Benjamin Meichsner 2013-03-12 12:50:56 +01:00
parent 6196bdae41
commit c4376f35bf

View file

@ -21,10 +21,9 @@ class Finance::BalancingController < Finance::BaseController
sort = "id"
end
@articles = @order.order_articles.ordered.includes(:order, :article, :article_price,
@articles = @order.order_articles.ordered.includes(:order, :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"