Force update in Order#finish; rescue if error raised

This commit is contained in:
Julius 2013-10-08 19:58:11 +02:00
parent 1b49a08c5e
commit 28644dc334
2 changed files with 3 additions and 1 deletions

View file

@ -98,6 +98,8 @@ class OrdersController < ApplicationController
order = Order.find(params[:id])
order.finish!(@current_user)
redirect_to order, notice: I18n.t('orders.finish.notice')
rescue => error
redirect_to orders_url, alert: I18n.t('errors.general_msg', :msg => error.message)
end
# Renders the fax-text-file