Skip to content

Commit

Permalink
Fix for edge
Browse files Browse the repository at this point in the history
  • Loading branch information
swistak committed Dec 23, 2009
1 parent 569d92e commit 42210f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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)
Expand Down

0 comments on commit 42210f9

Please sign in to comment.