From c8fa1168721b8ffa7721e7149b4103bec1818874 Mon Sep 17 00:00:00 2001 From: Roman Smirnov Date: Wed, 22 Jan 2014 22:47:42 +0400 Subject: [PATCH] Started upgrade to work with Spree 2.1.x --- app/models/spree/line_item_decorator.rb | 2 +- app/models/spree/order_decorator.rb | 2 +- spree_core_charges.gemspec | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index 365e35b..d80816a 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -6,7 +6,7 @@ def update_adjustment(adjustment, source) #source being the order 0 end - adjustment.update_attribute_without_callbacks(:amount, new_amount) + adjustment.update_column(:amount, new_amount) # Spree::Adjustment.skip_callback :save, :after, :update_adjustable # adjustment.save diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index 92c37de..9c5b049 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -27,7 +27,7 @@ def create_core_charges update_totals - update_attributes_without_callbacks({ + update_columns({ :adjustment_total => adjustment_total, :total => total }) diff --git a/spree_core_charges.gemspec b/spree_core_charges.gemspec index 5234d8d..8d014ca 100644 --- a/spree_core_charges.gemspec +++ b/spree_core_charges.gemspec @@ -6,14 +6,14 @@ Gem::Specification.new do |s| s.version = version s.authors = ['Denis Ivanov'] s.summary = 'Ability to have basic core charges added to orders' - s.required_ruby_version = '>= 1.9.2' + s.required_ruby_version = '>= 1.9.3' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.require_path = 'lib' s.requirements << 'none' - s.add_dependency('spree_core', '~> 2.0') + s.add_dependency('spree_core', '~> 2.1') s.add_development_dependency 'capybara' s.add_development_dependency 'factory_girl'