app/controllers/sales_controller.rb in artfully_ose-1.2.0.pre.19 vs app/controllers/sales_controller.rb in artfully_ose-1.2.0.pre.20
- old
+ new
@@ -23,9 +23,13 @@
end
end
unless @sale.errors.empty?
@sale.error = "#{@sale.errors.full_messages.to_sentence.capitalize}."
+ flash[:error] = @sale.error
+ Ticket.unlock(@sale.tickets, @sale.cart)
+ render :js => "window.location = '#{new_event_show_sales_path(@event, @show)}'"
+ return
end
render :json => @sale.as_json
.merge(:total => @sale.cart.total)
.merge(:tickets_remaining => tickets_remaining)