Move StockArticle#history to StockArticle#show

This commit is contained in:
Julius 2013-10-03 22:24:21 +02:00
parent a3e82f5304
commit fef8c6d99f
8 changed files with 42 additions and 49 deletions

View file

@ -31,6 +31,11 @@ class StockitController < ApplicationController
end
end
def show
@stock_article = StockArticle.find(params[:id])
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC')
end
def destroy
@article = StockArticle.find(params[:id])
@article.mark_as_deleted
@ -55,9 +60,4 @@ class StockitController < ApplicationController
render :partial => 'form', :locals => {:stock_article => stock_article}
end
def history
@stock_article = StockArticle.undeleted.find(params[:stock_article_id])
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC').each {|s| s.readonly!}
end
end