Class: Spree::Orders::UpdateContactInformation
- Inherits:
-
Object
- Object
- Spree::Orders::UpdateContactInformation
- Includes:
- ServiceModule::Base
- Defined in:
- app/services/spree/orders/update_contact_information.rb
Instance Method Summary collapse
Methods included from ServiceModule::Base
Instance Method Details
#call(order:, order_params:) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/spree/orders/update_contact_information.rb', line 6 def call(order:, order_params:) ActiveRecord::Base.transaction do order.update_columns(email: order_params[:email], updated_at: Time.current) if order.respond_to?(:vendor_orders) && order.vendor_orders.any? order.vendor_orders.update_all(email: order_params[:email], updated_at: Time.current) end end success(order.reload) end |