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" sort = "article_categories.name, articles.name"
end 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.where('articles.name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
@articles = @articles.page(params[:page]).per(@per_page) @articles = @articles.page(params[:page]).per(@per_page)