Prevent stock_articles from appearing in supplier article index

This commit is contained in:
Julius 2013-01-30 21:21:49 +01:00
parent 2c9fdcd79e
commit a511da9ae3

View file

@ -20,7 +20,7 @@ class ArticlesController < ApplicationController
sort = "article_categories.name, articles.name"
end
@articles = Article.where(supplier_id: @supplier).includes(:article_category).order(sort)
@articles = Article.where(supplier_id: @supplier, :type => nil).includes(:article_category).order(sort)
@articles = @articles.where('articles.name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
@articles = @articles.page(params[:page]).per(@per_page)
@ -231,4 +231,4 @@ class ArticlesController < ApplicationController
redirect_to supplier_articles_path(@supplier), :notice => "Der Katalog ist aktuell."
end
end
end
end