Permalink
Browse files

Fix discount calculation for non-persisted orders.

  • Loading branch information...
1 parent 3798d42 commit 4ffd7e630ce18d9c9c417357ab266f721d6ff50b Adam Wróbel committed Apr 13, 2011
Showing with 8 additions and 0 deletions.
  1. +1 −0 lib/spree_simple_volume_pricing.rb
  2. +7 −0 lib/spree_simple_volume_pricing/ext/active_record.rb
@@ -1,5 +1,6 @@
require 'spree_core'
require 'volume_pricing_hooks'
+require 'spree_simple_volume_pricing/ext/active_record'
module VolumePricing
class Engine < Rails::Engine
@@ -0,0 +1,7 @@
+module ActiveRecord::Persistence
+ # Update attributes of a record without callbacks, validations etc.
+ def update_attributes_without_callbacks(attributes)
+ self.send(:attributes=, attributes, false)
+ self.class.update_all(attributes, { :id => id }) if id
+ end
+end

0 comments on commit 4ffd7e6

Please sign in to comment.