From e453b130e4368fe4614b1f791503c9c3b4cd9f32 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 10 Jul 2020 17:21:35 +0100 Subject: [PATCH] Bring core/lib/spree/core/ext/active_record.rb to OFN and add it to Spree::Order, the only place where it is used --- app/models/spree/order_decorator.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index a3f750e620..15bcf6151c 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -378,6 +378,13 @@ Spree::Order.class_eval do address end + # Update attributes of a record in the database without callbacks, validations etc. + # This was originally a ext to ActiveRecord in Spree but only used for Spree::Order + def update_attributes_without_callbacks(attributes) + assign_attributes(attributes) + Spree::Order.where(id: id).update_all(attributes) + end + private def adjustments_fetcher