Permalink
Browse files

Fix for edge

  • Loading branch information...
1 parent 569d92e commit 42210f9d287ada38e5550802713018ad0d172084 @swistak swistak committed Dec 23, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 app/controllers/orders_controller_decorator.rb
@@ -1,5 +1,11 @@
OrdersController.class_eval do
- create.after do
+ # This is hack to get extension working with both edge and 0.9.x series
+ unless instance_methods.include?("create_before")
+ create.before :create_before
+ create.after.clear
+ end
+
+ def create_before
variant = nil; quantity = nil;
params[:products].each do |product_id,variant_id|
quantity = params[:quantity].to_i if !params[:quantity].is_a?(Array)

0 comments on commit 42210f9

Please sign in to comment.