Changed behaviour of acts_as_paraniod. Finder wrapper removed an replaced by simple named_scope 'without_deleted'.

This commit is contained in:
Benjamin Meichsner 2009-02-11 15:23:59 +01:00
parent cd9636a650
commit 325d47b22f
18 changed files with 218 additions and 136 deletions

View file

@ -52,12 +52,12 @@ class Order < ActiveRecord::Base
def articles_for_ordering
if stockit?
StockArticle.available.all(:include => :article_category,
StockArticle.available.without_deleted(:include => :article_category,
:order => 'article_categories.name, articles.name').reject{ |a|
a.quantity_available == 0
}.group_by { |a| a.article_category.name }
else
supplier.articles.available.all.group_by { |a| a.article_category.name }
supplier.articles.available.without_deleted.group_by { |a| a.article_category.name }
end
end