spree_core 5.1.0.rc1 → 5.1.0

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: a357b0d9005bb8d7ed5b4b56ebe020d34435ac15a402db9d650880ae01c38127
4
- data.tar.gz: 729183094fa42d6d5b00632e5b9d44b61958643aef7b42d1b7931dd98c87b0f6
3
+ metadata.gz: 10a63ea31ea45db426f45aa13fb90de77dac8ab0a024f7812562aed34991b9e8
4
+ data.tar.gz: 2ca5104581c280ce3b1328e52bfd8988971012feb01287174b4afa3ea494917c
5
5
  SHA512:
6
- metadata.gz: 49525a096671b7fce9970204619b1d05d7a421b3d6966b2ca139e492dda1ee2cd3a7339b3ee37ebbb4a31e2e93cdcfc49f8dffd6371ca91f813d9782259bf91f
7
- data.tar.gz: faff9b9dd0388d354efcef394b6051951426824ee4d9e05ad5e6c3f952cf3eeba46ba40e631ee306f861529f840efb01e5b138075c188300bded5a88aec65d49
6
+ metadata.gz: f23f420db0bcced89590044a3b101754c934b06bc882adbe288163ef9b46166e829f79c824ad3eb83329ed8b6eb4e03aefcac8d1e5783eec42e7ba00ceb59dcb
7
+ data.tar.gz: d6c770cd94212ca2f919a62eeafc5bc58cc1440da8c3f98c9c6421c20fd12188995e0f93662225d0fb91d7afe769ae5488fc4b34360aeaa5fec2443e14216a49
@@ -48,7 +48,9 @@ module Spree
48
48
  #
49
49
  # Attributes
50
50
  #
51
- accepts_nested_attributes_for :option_values, reject_if: ->(ov) { ov[:name].blank? || ov[:presentation].blank? }, allow_destroy: true
51
+ accepts_nested_attributes_for :option_values, reject_if: lambda { |ov|
52
+ ov[:id].blank? && (ov[:name].blank? || ov[:presentation].blank?)
53
+ }, allow_destroy: true
52
54
 
53
55
  #
54
56
  # Callbacks
@@ -27,39 +27,39 @@ module Spree
27
27
  upper_limit_condition = true
28
28
  end
29
29
 
30
- eligibility_errors.add(:base, ineligible_message_max) unless upper_limit_condition
31
- eligibility_errors.add(:base, ineligible_message_min) unless lower_limit_condition
30
+ eligibility_errors.add(:base, ineligible_message_max(order)) unless upper_limit_condition
31
+ eligibility_errors.add(:base, ineligible_message_min(order)) unless lower_limit_condition
32
32
 
33
33
  eligibility_errors.empty?
34
34
  end
35
35
 
36
36
  private
37
37
 
38
- def formatted_amount_min
39
- Spree::Money.new(preferred_amount_min).to_s
38
+ def formatted_amount_min(order)
39
+ Spree::Money.new(preferred_amount_min, currency: order.currency).to_s
40
40
  end
41
41
 
42
- def formatted_amount_max
42
+ def formatted_amount_max(order)
43
43
  if preferred_amount_max.present?
44
- Spree::Money.new(preferred_amount_max).to_s
44
+ Spree::Money.new(preferred_amount_max, currency: order.currency).to_s
45
45
  else
46
46
  Spree.t('no_maximum')
47
47
  end
48
48
  end
49
49
 
50
- def ineligible_message_max
50
+ def ineligible_message_max(order)
51
51
  if preferred_operator_max == 'lt'
52
- eligibility_error_message(:item_total_more_than_or_equal, amount: formatted_amount_max)
52
+ eligibility_error_message(:item_total_more_than_or_equal, amount: formatted_amount_max(order))
53
53
  else
54
- eligibility_error_message(:item_total_more_than, amount: formatted_amount_max)
54
+ eligibility_error_message(:item_total_more_than, amount: formatted_amount_max(order))
55
55
  end
56
56
  end
57
57
 
58
- def ineligible_message_min
58
+ def ineligible_message_min(order)
59
59
  if preferred_operator_min == 'gte'
60
- eligibility_error_message(:item_total_less_than, amount: formatted_amount_min)
60
+ eligibility_error_message(:item_total_less_than, amount: formatted_amount_min(order))
61
61
  else
62
- eligibility_error_message(:item_total_less_than_or_equal, amount: formatted_amount_min)
62
+ eligibility_error_message(:item_total_less_than_or_equal, amount: formatted_amount_min(order))
63
63
  end
64
64
  end
65
65
  end
@@ -240,7 +240,9 @@ module Spree
240
240
  ]
241
241
 
242
242
  Rails.application.config.spree.translatable_resources = [
243
+ Spree::OptionType,
243
244
  Spree::Product,
245
+ Spree::Property,
244
246
  Spree::Taxon,
245
247
  Spree::Taxonomy,
246
248
  Spree::Store
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '5.1.0.rc1'.freeze
2
+ VERSION = '5.1.0'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -10,6 +10,7 @@ Capybara.configure do |config|
10
10
  config.match = :smart
11
11
  config.ignore_hidden_elements = true
12
12
  end
13
+ Capybara.test_id = 'data-test-id'
13
14
 
14
15
  if ENV['WEBDRIVER'] == 'accessible'
15
16
  require 'capybara/accessible'
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.0.rc1
4
+ version: 5.1.0
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-07-02 00:00:00.000000000 Z
13
+ date: 2025-07-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: i18n-tasks
@@ -1382,9 +1382,9 @@ licenses:
1382
1382
  - BSD-3-Clause
1383
1383
  metadata:
1384
1384
  bug_tracker_uri: https://github.com/spree/spree/issues
1385
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.rc1
1385
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0
1386
1386
  documentation_uri: https://docs.spreecommerce.org/
1387
- source_code_uri: https://github.com/spree/spree/tree/v5.1.0.rc1
1387
+ source_code_uri: https://github.com/spree/spree/tree/v5.1.0
1388
1388
  post_install_message:
1389
1389
  rdoc_options: []
1390
1390
  require_paths: