Make stock_changes readonly in index view

This commit is contained in:
Julius 2013-07-11 18:20:24 +02:00
parent de9541a0df
commit ffcb9490c9
1 changed files with 1 additions and 1 deletions

View File

@ -3,6 +3,6 @@ class StockChangesController < ApplicationController
before_filter :find_stock_article
def index
@stock_changes = @stock_article.stock_changes(:readonly => true).order('stock_changes.created_at DESC') # The readonly has no effect, what is the proper way to achieve that?
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC').each {|s| s.readonly!}
end
end