spree_core 5.1.6 → 5.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b7ada6c326700f36766e181d422238f5fc9c8e345b92b37df8d5c2ed5e1b56c
4
- data.tar.gz: 86b6aabcab0463033b6a8e045445b8b7b90109f9f8a7d5e3084ffad2d5093bab
3
+ metadata.gz: f3e90428ce89c62f05918a8c7d2645e3ed5a0c8f6e2bf5d504449c02d061d2e0
4
+ data.tar.gz: a35d5f33881801b2378568cd6b74ece89ea605be53eb55a0c2dbcf1e4858cdd6
5
5
  SHA512:
6
- metadata.gz: cc6d619e2582cc97f6444f55f49db531cc5adc7dcc9c5349e6401c8d15d26c23b2e46d25219135a2a73841c2ddf207e5ab76d3e6cebcf584128118636bc714a3
7
- data.tar.gz: ce1337606b76a87689543518feb7dcac21d7ed3b62bfb3d14a1b703a0a90da357c8d9476228971c01a63b850152311ef68c2fdec3f4ee620b0631c9e845e6bf8
6
+ metadata.gz: 58de2ea5287871bd79d851c088e26db20f8446702dd29f01ec9f26c2814fdfa511910df3fbeaeb1a48d70c715545602fade93a454b0247bc6891516b52436dbc
7
+ data.tar.gz: 5e990e7726d44c047abb3d3ee65eb221953ace057e0465b69fb619cb1b78c19d5c151bd3af20e3ea5e1452bc61acbe5a7194dafbadf5f7befa0899d374bb8c4c
@@ -66,8 +66,10 @@ module Spree
66
66
  Spree::Money.new(compare_at_amount || 0, currency: currency)
67
67
  end
68
68
 
69
- def compare_at_amount=(compare_at_amount)
70
- self[:compare_at_amount] = Spree::LocalizedNumber.parse(compare_at_amount)
69
+ def compare_at_amount=(value)
70
+ calculated_value = Spree::LocalizedNumber.parse(value) if value.present?
71
+
72
+ self[:compare_at_amount] = calculated_value
71
73
  end
72
74
 
73
75
  alias_attribute :price, :amount
@@ -191,8 +191,7 @@ module Spree
191
191
  if discount || created_line_items
192
192
  handle_coupon_code(discount, coupon_code) if discount
193
193
 
194
- order.update_totals
195
- order.persist_totals
194
+ order.update_with_updater!
196
195
  set_success_code :coupon_code_applied
197
196
  elsif order.promotions.with_coupon_code(order.coupon_code)
198
197
  # since CouponCode is disposable...
@@ -44,6 +44,7 @@ module Spree
44
44
  state: 'checkout',
45
45
  response_code: store_credit.generate_authorization_code
46
46
  )
47
+ order.update_with_updater!
47
48
  end
48
49
 
49
50
  success(order.reload)
@@ -29,6 +29,7 @@ module Spree
29
29
  end
30
30
 
31
31
  order.update!(gift_card: nil)
32
+ order.update_with_updater!
32
33
  end
33
34
 
34
35
  success(true)
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '5.1.6'.freeze
2
+ VERSION = '5.1.7'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
data/lib/tasks/core.rake CHANGED
@@ -204,4 +204,17 @@ namespace :core do
204
204
  task archive_products: :environment do |_t, _args|
205
205
  Spree::Product.where('discontinue_on <= ?', Time.current).where.not(status: 'archived').update_all(status: 'archived', updated_at: Time.current)
206
206
  end
207
+
208
+ desc 'Migrate amount spree_prices.compare_at_amount.'
209
+ task migrate_compare_at_amount: :environment do |_t, _args|
210
+ include ActionView::Helpers::TextHelper
211
+ puts '... started'
212
+ total = 0
213
+ Spree::Price.where(compare_at_amount: 0).in_batches do |prices|
214
+ prices.update_all(compare_at_amount: nil)
215
+ total += prices.count
216
+ end
217
+ puts '... done'
218
+ puts "... migrated #{pluralize(total, 'record')}"
219
+ end
207
220
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.6
4
+ version: 5.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-09-18 00:00:00.000000000 Z
13
+ date: 2025-09-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n-tasks
@@ -1383,9 +1383,9 @@ licenses:
1383
1383
  - BSD-3-Clause
1384
1384
  metadata:
1385
1385
  bug_tracker_uri: https://github.com/spree/spree/issues
1386
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.6
1386
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.7
1387
1387
  documentation_uri: https://docs.spreecommerce.org/
1388
- source_code_uri: https://github.com/spree/spree/tree/v5.1.6
1388
+ source_code_uri: https://github.com/spree/spree/tree/v5.1.7
1389
1389
  post_install_message:
1390
1390
  rdoc_options: []
1391
1391
  require_paths: