Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed: PG::SyntaxError: ERROR: multiple assignments to same column "updated_at"

Damian Legawieca55b5d320ac9
diff --git a/core/app/models/spree/price_list.rb b/core/app/models/spree/price_list.rb
index 5e1b6ce789..02687071bb 100644
--- a/core/app/models/spree/price_list.rb
+++ b/core/app/models/spree/price_list.rb
@@ -139,7 +139,6 @@ module Spree
def bulk_update_prices(prices_attributes)
return true if prices_attributes.blank?
- now = Time.current
records_to_upsert = []
variant_ids = Set.new
@@ -170,8 +169,7 @@ module Spree
currency: attrs[:currency],
amount: amount,
compare_at_amount: compare_at_amount,
- price_list_id: id,
- updated_at: now
+ price_list_id: id
}
variant_ids << attrs[:variant_id].to_i
@@ -182,7 +180,7 @@ module Spree
Spree::Price.upsert_all(
records_to_upsert,
unique_by: :id,
- update_only: [:amount, :compare_at_amount, :updated_at]
+ update_only: [:amount, :compare_at_amount]
)
touch_variants(variant_ids.to_a)