Permalink
Browse files

Render 404 for /order/:id/sberbank_invoice when order.payment_method …

…is not SberBankInvoice
  • Loading branch information...
1 parent f5844e0 commit a5b65453668f509e422a6e8aff05fa22b8b2112d @c0va23 c0va23 committed Apr 9, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 app/controllers/orders_controller_decorator.rb
View
3 app/controllers/orders_controller_decorator.rb
@@ -1,6 +1,9 @@
OrdersController.class_eval do
def sberbank_invoice
@order = Order.find_by_number!(params[:id])
+ unless @order.payment_method.is_a?(PaymentMethod::SberBankInvoice)
+ render_404 and return
+ end
@preferences = @order.payment_method.preferences
render :layout => false
end

0 comments on commit a5b6545

Please sign in to comment.