spree_core 4.7.2 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/app/finders/spree/taxons/find.rb +7 -3
  4. data/app/models/concerns/spree/named_type.rb +1 -1
  5. data/app/models/concerns/spree/product_scopes.rb +19 -19
  6. data/app/models/concerns/spree/user_address.rb +4 -2
  7. data/app/models/spree/address.rb +2 -21
  8. data/app/models/spree/asset.rb +2 -2
  9. data/app/models/spree/calculator/default_tax.rb +1 -1
  10. data/app/models/spree/cms_page.rb +3 -3
  11. data/app/models/spree/cms_section.rb +1 -1
  12. data/app/models/spree/country.rb +0 -26
  13. data/app/models/spree/credit_card.rb +5 -3
  14. data/app/models/spree/customer_return.rb +3 -3
  15. data/app/models/spree/digital.rb +1 -1
  16. data/app/models/spree/digital_link.rb +1 -1
  17. data/app/models/spree/image.rb +2 -2
  18. data/app/models/spree/inventory_unit.rb +1 -1
  19. data/app/models/spree/legacy_user.rb +3 -3
  20. data/app/models/spree/line_item.rb +2 -2
  21. data/app/models/spree/menu.rb +2 -2
  22. data/app/models/spree/menu_item.rb +1 -1
  23. data/app/models/spree/option_type.rb +6 -6
  24. data/app/models/spree/option_value.rb +5 -5
  25. data/app/models/spree/order.rb +9 -7
  26. data/app/models/spree/payment.rb +4 -4
  27. data/app/models/spree/payment_capture_event.rb +1 -1
  28. data/app/models/spree/payment_method.rb +1 -1
  29. data/app/models/spree/payment_source.rb +1 -1
  30. data/app/models/spree/price.rb +4 -2
  31. data/app/models/spree/product.rb +30 -19
  32. data/app/models/spree/product_property.rb +5 -3
  33. data/app/models/spree/promotion.rb +3 -3
  34. data/app/models/spree/property.rb +8 -6
  35. data/app/models/spree/prototype.rb +2 -2
  36. data/app/models/spree/refund.rb +2 -2
  37. data/app/models/spree/reimbursement.rb +2 -2
  38. data/app/models/spree/return_authorization.rb +2 -2
  39. data/app/models/spree/return_item.rb +1 -1
  40. data/app/models/spree/role.rb +1 -1
  41. data/app/models/spree/shipment.rb +4 -4
  42. data/app/models/spree/shipping_category.rb +2 -2
  43. data/app/models/spree/shipping_method.rb +2 -2
  44. data/app/models/spree/stock/estimator.rb +1 -1
  45. data/app/models/spree/stock_item.rb +3 -3
  46. data/app/models/spree/stock_location.rb +7 -2
  47. data/app/models/spree/stock_movement.rb +1 -1
  48. data/app/models/spree/stock_transfer.rb +4 -4
  49. data/app/models/spree/store.rb +3 -5
  50. data/app/models/spree/store_credit.rb +3 -3
  51. data/app/models/spree/store_favicon_image.rb +11 -2
  52. data/app/models/spree/tax_category.rb +1 -1
  53. data/app/models/spree/tax_rate.rb +1 -1
  54. data/app/models/spree/taxon.rb +23 -7
  55. data/app/models/spree/taxon_image.rb +2 -2
  56. data/app/models/spree/taxonomy.rb +5 -5
  57. data/app/models/spree/variant.rb +11 -6
  58. data/app/models/spree/wished_item.rb +1 -1
  59. data/app/models/spree/wishlist.rb +2 -2
  60. data/app/models/spree/zone.rb +2 -2
  61. data/app/services/spree/addresses/update.rb +1 -0
  62. data/app/services/spree/seeds/all.rb +15 -13
  63. data/app/services/spree/seeds/stores.rb +2 -2
  64. data/app/sorters/spree/products/sort.rb +1 -1
  65. data/config/initializers/mobility.rb +1 -0
  66. data/config/routes.rb +7 -8
  67. data/db/migrate/20210929090344_create_stock_item_stock_location_id_variant_id_coalesce_deleted_at_unique_index.rb +1 -28
  68. data/db/migrate/20230103144439_create_option_type_translations.rb +0 -1
  69. data/db/migrate/20230103151034_create_option_value_translations.rb +0 -1
  70. data/db/migrate/20230109084253_create_product_property_translations.rb +0 -1
  71. data/db/migrate/20230109105943_create_property_translations.rb +0 -2
  72. data/db/migrate/20230110142344_backfill_friendly_id_slug_locale.rb +2 -8
  73. data/db/migrate/20240303174340_fix_spree_stock_item_unique_index.rb +35 -0
  74. data/db/migrate/20240514105216_add_weight_and_dimension_units_to_spree_variants.rb +6 -0
  75. data/lib/generators/spree/custom_authentication/custom_authentication_generator.rb +23 -0
  76. data/lib/generators/spree/{custom_user → custom_authentication}/templates/authentication_helpers.rb.tt +1 -14
  77. data/lib/generators/spree/custom_user/custom_user_generator.rb +3 -8
  78. data/lib/generators/spree/custom_user/templates/current_user_helpers.rb.tt +15 -0
  79. data/lib/generators/spree/custom_user/templates/migration.rb.tt +2 -2
  80. data/lib/generators/spree/dummy/dummy_generator.rb +1 -6
  81. data/lib/generators/spree/dummy/templates/rails/database.yml +19 -21
  82. data/lib/generators/spree/dummy/templates/rails/test.rb +1 -1
  83. data/lib/generators/spree/install/templates/config/initializers/spree.rb +25 -0
  84. data/lib/spree/core/configuration.rb +11 -25
  85. data/lib/spree/core/controller_helpers/locale.rb +5 -1
  86. data/lib/spree/core/engine.rb +4 -1
  87. data/lib/spree/core/preferences/runtime_configuration.rb +43 -0
  88. data/lib/spree/core/product_duplicator.rb +2 -0
  89. data/lib/spree/core/product_filters.rb +9 -2
  90. data/lib/spree/core/runtime_configuration.rb +9 -0
  91. data/lib/spree/core/version.rb +1 -1
  92. data/lib/spree/core/webhooks.rb +13 -0
  93. data/lib/spree/core.rb +7 -0
  94. data/lib/spree/money.rb +38 -5
  95. data/lib/spree/testing_support/authorization_helpers.rb +3 -1
  96. data/lib/spree/testing_support/common_rake.rb +7 -18
  97. data/spree_core.gemspec +7 -7
  98. metadata +47 -50
  99. data/db/migrate/20220715120222_change_product_name_null_to_true.rb +0 -5
  100. data/db/migrate/20220718100948_change_taxon_name_null_to_true.rb +0 -5
  101. data/db/migrate/20220804073928_transfer_data_to_translatable_tables.rb +0 -66
  102. data/db/migrate/20230109094907_transfer_options_data_to_translatable_tables.rb +0 -58
  103. data/db/migrate/20230109110840_transfer_property_data_to_translatable_tables.rb +0 -59
  104. data/db/migrate/20230111122511_transfer_product_and_taxon_data_to_translatable_tables.rb +0 -82
  105. data/db/migrate/20230117120430_allow_null_taxonomy_name.rb +0 -5
  106. data/db/migrate/20230117121303_transfer_taxonomy_data_to_translatable_tables.rb +0 -11
  107. data/db/migrate/20230210142849_transfer_store_data_to_translatable_tables.rb +0 -11
  108. data/db/migrate/20230514162157_add_index_on_locale_and_permalink_to_spree_taxons.rb +0 -5
data/lib/spree/money.rb CHANGED
@@ -5,8 +5,15 @@ Money.rounding_mode = BigDecimal::ROUND_HALF_UP
5
5
 
6
6
  module Spree
7
7
  class Money
8
+ include Comparable
9
+
8
10
  class << self
9
11
  attr_accessor :default_formatting_rules
12
+
13
+ def from_cents(amount_in_cents, options = {})
14
+ money = ::Money.from_cents(amount_in_cents, options[:currency])
15
+ new(money.to_d, options)
16
+ end
10
17
  end
11
18
 
12
19
  self.default_formatting_rules = {
@@ -17,10 +24,10 @@ module Spree
17
24
 
18
25
  attr_reader :money
19
26
 
20
- delegate :cents, :currency, to: :money
27
+ delegate :cents, :currency, :to_d, :positive?, :zero?, to: :money
21
28
 
22
29
  def initialize(amount, options = {})
23
- use_default_currency
30
+ ::Money.default_currency ||= Spree::Store.default.default_currency || 'USD'
24
31
  @money = Monetize.parse([amount, (options[:currency] || Spree::Store.default.default_currency)].join)
25
32
  @options = Spree::Money.default_formatting_rules.merge(options)
26
33
  end
@@ -29,10 +36,18 @@ module Spree
29
36
  (cents / currency.subunit_to_unit.to_f * 100).round
30
37
  end
31
38
 
39
+ def abs
40
+ self.class.new(money.abs, options)
41
+ end
42
+
32
43
  def to_s
33
44
  money&.format(options)
34
45
  end
35
46
 
47
+ def inspect
48
+ "#{self.class}(cents: #{cents}, currency: #{currency})"
49
+ end
50
+
36
51
  # 1) prevent blank, breaking spaces
37
52
  # 2) prevent escaping of HTML character entities
38
53
  def to_html(opts = { html: true })
@@ -65,9 +80,27 @@ module Spree
65
80
  money == obj.money
66
81
  end
67
82
 
68
- def use_default_currency
69
- currency = Spree::Store.default.default_currency
70
- ::Money.default_currency = currency
83
+ def +(other)
84
+ result_money = money + other.money
85
+ self.class.new(result_money.to_s, options)
86
+ end
87
+
88
+ def -(other)
89
+ result_money = money - other.money
90
+ self.class.new(result_money.to_s, options)
91
+ end
92
+
93
+ def *(value)
94
+ result_money = money * value
95
+ self.class.new(result_money.to_s, options)
96
+ end
97
+
98
+ def <=>(other)
99
+ money <=> other.money
100
+ end
101
+
102
+ def -@
103
+ self.class.new((-money).to_s, options)
71
104
  end
72
105
 
73
106
  private
@@ -37,12 +37,14 @@ module Spree
37
37
  ability_class.register_ability(ability)
38
38
  end
39
39
 
40
+ let(:user) { Spree.user_class.new }
40
41
  let(:admin_app) { Spree::OauthApplication.create!(name: 'Admin Panel', scopes: 'admin') }
41
42
  let(:admin_token) { Spree::OauthAccessToken.create!(application: admin_app, scopes: 'admin').token }
42
43
 
43
44
  before do
44
- allow(Spree.user_class).to receive(:find_by).and_return(Spree.user_class.new)
45
+ allow(Spree.user_class).to receive(:find_by).and_return(user)
45
46
  if defined?(Spree::Admin)
47
+ allow_any_instance_of(Spree::Admin::BaseController).to receive(:try_spree_current_user).and_return(user)
46
48
  allow_any_instance_of(Spree::Admin::BaseController).to receive(:admin_oauth_application).and_return(admin_app)
47
49
  allow_any_instance_of(Spree::Admin::BaseController).to receive(:admin_oauth_token).and_return(admin_token)
48
50
  end
@@ -14,21 +14,21 @@ namespace :common do
14
14
  ENV['RAILS_ENV'] = 'test'
15
15
  Rails.env = 'test'
16
16
 
17
- if ENV['LIB_NAME'] == 'spree/backend'
18
- puts 'Preparing NPM package...'
19
- system('yarn install')
20
- system('yarn build')
21
- system('yarn link')
17
+ Spree::DummyGenerator.start ["--lib_name=#{ENV['LIB_NAME']}"]
18
+
19
+ # install frontend libraries
20
+ unless ['spree/api', 'spree/core', 'spree/sample'].include?(ENV['LIB_NAME'])
21
+ system('bin/rails importmap:install')
22
+ system('bin/rails turbo:install')
23
+ system('bin/rails stimulus:install')
22
24
  end
23
25
 
24
- Spree::DummyGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", '--quiet']
25
26
  Spree::InstallGenerator.start [
26
27
  "--lib_name=#{ENV['LIB_NAME']}",
27
28
  '--auto-accept',
28
29
  '--migrate=false',
29
30
  '--seed=false',
30
31
  '--sample=false',
31
- '--quiet',
32
32
  '--copy_storefront=false',
33
33
  "--install_storefront=#{args[:install_storefront]}",
34
34
  "--install_admin=#{args[:install_admin]}",
@@ -41,12 +41,6 @@ namespace :common do
41
41
  Spree::DummyModelGenerator.start
42
42
  system('bundle exec rake db:migrate')
43
43
 
44
- unless ['spree/api', 'spree/core', 'spree/sample', 'spree/emails'].include?(ENV['LIB_NAME'])
45
- puts 'Setting up node environment'
46
- system('bin/rails javascript:install:esbuild')
47
- system('bin/rails turbo:install')
48
- end
49
-
50
44
  begin
51
45
  require "generators/#{ENV['LIB_NAME']}/install/install_generator"
52
46
  puts 'Running extension installation generator...'
@@ -56,11 +50,6 @@ namespace :common do
56
50
  end
57
51
 
58
52
  unless ['spree/api', 'spree/core', 'spree/sample'].include?(ENV['LIB_NAME'])
59
- if ENV['LIB_NAME'] == 'spree/backend'
60
- puts 'Installing node dependencies...'
61
- system('yarn link @spree/dashboard')
62
- system('yarn install')
63
- end
64
53
  puts 'Precompiling assets...'
65
54
  system('bundle exec rake assets:precompile')
66
55
  end
data/spree_core.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.metadata = {
17
17
  "bug_tracker_uri" => "https://github.com/spree/spree/issues",
18
18
  "changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
19
- "documentation_uri" => "https://dev-docs.spreecommerce.org/",
19
+ "documentation_uri" => "https://docs.spreecommerce.org/",
20
20
  "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
21
21
  }
22
22
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
30
30
  actionpack actionview activejob activemodel activerecord
31
31
  activestorage activesupport railties
32
32
  ].each do |rails_gem|
33
- s.add_dependency rails_gem, '>= 6.1', '< 7.2'
33
+ s.add_dependency rails_gem, '>= 6.1', '< 8.0'
34
34
  end
35
35
 
36
36
  s.add_dependency 'activemerchant', '~> 1.67'
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  s.add_dependency 'carmen', '>= 1.0'
41
41
  s.add_dependency 'cancancan', '~> 3.2'
42
42
  s.add_dependency 'friendly_id', '~> 5.2', '>= 5.2.1'
43
- s.add_dependency 'highline', '~> 2.0' # Necessary for the install generator
43
+ s.add_dependency 'highline', '>= 2', '< 4' # Necessary for the install generator
44
44
  s.add_dependency 'kaminari', '~> 1.2'
45
45
  s.add_dependency 'money', '~> 6.13'
46
46
  s.add_dependency 'monetize', '~> 1.9'
@@ -52,9 +52,9 @@ Gem::Specification.new do |s|
52
52
  s.add_dependency 'stringex'
53
53
  s.add_dependency 'validates_zipcode'
54
54
  s.add_dependency 'image_processing', '~> 1.2'
55
- s.add_dependency 'active_storage_validations', '~> 0.9', '<= 0.9.5'
55
+ s.add_dependency 'active_storage_validations', '~> 1.1'
56
56
  s.add_dependency 'activerecord-typedstore'
57
- s.add_dependency 'mobility', '~> 1.2.9'
58
- s.add_dependency 'mobility-ransack', '~> 1.2.1'
59
- s.add_dependency 'friendly_id-mobility', '~> 1.0.4'
57
+ s.add_dependency 'mobility', '~> 1.2'
58
+ s.add_dependency 'mobility-ransack', '~> 1.2'
59
+ s.add_dependency 'friendly_id-mobility', '~> 1.0'
60
60
  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: 4.7.2
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-21 00:00:00.000000000 Z
12
+ date: 2024-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '6.1'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '7.2'
23
+ version: '8.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '6.1'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.2'
33
+ version: '8.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: actionview
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '6.1'
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '7.2'
43
+ version: '8.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: '6.1'
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '7.2'
53
+ version: '8.0'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: activejob
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -60,7 +60,7 @@ dependencies:
60
60
  version: '6.1'
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
- version: '7.2'
63
+ version: '8.0'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
@@ -70,7 +70,7 @@ dependencies:
70
70
  version: '6.1'
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
- version: '7.2'
73
+ version: '8.0'
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: activemodel
76
76
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +80,7 @@ dependencies:
80
80
  version: '6.1'
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
- version: '7.2'
83
+ version: '8.0'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  version: '6.1'
91
91
  - - "<"
92
92
  - !ruby/object:Gem::Version
93
- version: '7.2'
93
+ version: '8.0'
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: activerecord
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ dependencies:
100
100
  version: '6.1'
101
101
  - - "<"
102
102
  - !ruby/object:Gem::Version
103
- version: '7.2'
103
+ version: '8.0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ dependencies:
110
110
  version: '6.1'
111
111
  - - "<"
112
112
  - !ruby/object:Gem::Version
113
- version: '7.2'
113
+ version: '8.0'
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: activestorage
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '6.1'
121
121
  - - "<"
122
122
  - !ruby/object:Gem::Version
123
- version: '7.2'
123
+ version: '8.0'
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ dependencies:
130
130
  version: '6.1'
131
131
  - - "<"
132
132
  - !ruby/object:Gem::Version
133
- version: '7.2'
133
+ version: '8.0'
134
134
  - !ruby/object:Gem::Dependency
135
135
  name: activesupport
136
136
  requirement: !ruby/object:Gem::Requirement
@@ -140,7 +140,7 @@ dependencies:
140
140
  version: '6.1'
141
141
  - - "<"
142
142
  - !ruby/object:Gem::Version
143
- version: '7.2'
143
+ version: '8.0'
144
144
  type: :runtime
145
145
  prerelease: false
146
146
  version_requirements: !ruby/object:Gem::Requirement
@@ -150,7 +150,7 @@ dependencies:
150
150
  version: '6.1'
151
151
  - - "<"
152
152
  - !ruby/object:Gem::Version
153
- version: '7.2'
153
+ version: '8.0'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: railties
156
156
  requirement: !ruby/object:Gem::Requirement
@@ -160,7 +160,7 @@ dependencies:
160
160
  version: '6.1'
161
161
  - - "<"
162
162
  - !ruby/object:Gem::Version
163
- version: '7.2'
163
+ version: '8.0'
164
164
  type: :runtime
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,7 +170,7 @@ dependencies:
170
170
  version: '6.1'
171
171
  - - "<"
172
172
  - !ruby/object:Gem::Version
173
- version: '7.2'
173
+ version: '8.0'
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: activemerchant
176
176
  requirement: !ruby/object:Gem::Requirement
@@ -285,16 +285,22 @@ dependencies:
285
285
  name: highline
286
286
  requirement: !ruby/object:Gem::Requirement
287
287
  requirements:
288
- - - "~>"
288
+ - - ">="
289
+ - !ruby/object:Gem::Version
290
+ version: '2'
291
+ - - "<"
289
292
  - !ruby/object:Gem::Version
290
- version: '2.0'
293
+ version: '4'
291
294
  type: :runtime
292
295
  prerelease: false
293
296
  version_requirements: !ruby/object:Gem::Requirement
294
297
  requirements:
295
- - - "~>"
298
+ - - ">="
299
+ - !ruby/object:Gem::Version
300
+ version: '2'
301
+ - - "<"
296
302
  - !ruby/object:Gem::Version
297
- version: '2.0'
303
+ version: '4'
298
304
  - !ruby/object:Gem::Dependency
299
305
  name: kaminari
300
306
  requirement: !ruby/object:Gem::Requirement
@@ -455,20 +461,14 @@ dependencies:
455
461
  requirements:
456
462
  - - "~>"
457
463
  - !ruby/object:Gem::Version
458
- version: '0.9'
459
- - - "<="
460
- - !ruby/object:Gem::Version
461
- version: 0.9.5
464
+ version: '1.1'
462
465
  type: :runtime
463
466
  prerelease: false
464
467
  version_requirements: !ruby/object:Gem::Requirement
465
468
  requirements:
466
469
  - - "~>"
467
470
  - !ruby/object:Gem::Version
468
- version: '0.9'
469
- - - "<="
470
- - !ruby/object:Gem::Version
471
- version: 0.9.5
471
+ version: '1.1'
472
472
  - !ruby/object:Gem::Dependency
473
473
  name: activerecord-typedstore
474
474
  requirement: !ruby/object:Gem::Requirement
@@ -489,42 +489,42 @@ dependencies:
489
489
  requirements:
490
490
  - - "~>"
491
491
  - !ruby/object:Gem::Version
492
- version: 1.2.9
492
+ version: '1.2'
493
493
  type: :runtime
494
494
  prerelease: false
495
495
  version_requirements: !ruby/object:Gem::Requirement
496
496
  requirements:
497
497
  - - "~>"
498
498
  - !ruby/object:Gem::Version
499
- version: 1.2.9
499
+ version: '1.2'
500
500
  - !ruby/object:Gem::Dependency
501
501
  name: mobility-ransack
502
502
  requirement: !ruby/object:Gem::Requirement
503
503
  requirements:
504
504
  - - "~>"
505
505
  - !ruby/object:Gem::Version
506
- version: 1.2.1
506
+ version: '1.2'
507
507
  type: :runtime
508
508
  prerelease: false
509
509
  version_requirements: !ruby/object:Gem::Requirement
510
510
  requirements:
511
511
  - - "~>"
512
512
  - !ruby/object:Gem::Version
513
- version: 1.2.1
513
+ version: '1.2'
514
514
  - !ruby/object:Gem::Dependency
515
515
  name: friendly_id-mobility
516
516
  requirement: !ruby/object:Gem::Requirement
517
517
  requirements:
518
518
  - - "~>"
519
519
  - !ruby/object:Gem::Version
520
- version: 1.0.4
520
+ version: '1.0'
521
521
  type: :runtime
522
522
  prerelease: false
523
523
  version_requirements: !ruby/object:Gem::Requirement
524
524
  requirements:
525
525
  - - "~>"
526
526
  - !ruby/object:Gem::Version
527
- version: 1.0.4
527
+ version: '1.0'
528
528
  description: Spree Models, Helpers, Services and core libraries
529
529
  email: hello@spreecommerce.org
530
530
  executables: []
@@ -917,12 +917,9 @@ files:
917
917
  - db/migrate/20220613133029_add_metadata_to_spree_stock_items.rb
918
918
  - db/migrate/20220706112554_create_product_name_and_description_translations_for_mobility_table_backend.rb
919
919
  - db/migrate/20220715083542_create_spree_product_translations_for_mobility.rb
920
- - db/migrate/20220715120222_change_product_name_null_to_true.rb
921
920
  - db/migrate/20220718100743_create_spree_taxon_name_and_description_translations_for_mobility_table_backend.rb
922
- - db/migrate/20220718100948_change_taxon_name_null_to_true.rb
923
921
  - db/migrate/20220802070609_add_locale_to_friendly_id_slugs.rb
924
922
  - db/migrate/20220802073225_create_spree_product_slug_translations_for_mobility_table_backend.rb
925
- - db/migrate/20220804073928_transfer_data_to_translatable_tables.rb
926
923
  - db/migrate/20221215151408_add_selected_locale_to_spree_users.rb
927
924
  - db/migrate/20221219123957_add_deleted_at_to_product_translations.rb
928
925
  - db/migrate/20221220133432_add_uniqueness_constraint_to_product_translations.rb
@@ -930,27 +927,24 @@ files:
930
927
  - db/migrate/20230103144439_create_option_type_translations.rb
931
928
  - db/migrate/20230103151034_create_option_value_translations.rb
932
929
  - db/migrate/20230109084253_create_product_property_translations.rb
933
- - db/migrate/20230109094907_transfer_options_data_to_translatable_tables.rb
934
930
  - db/migrate/20230109105943_create_property_translations.rb
935
- - db/migrate/20230109110840_transfer_property_data_to_translatable_tables.rb
936
931
  - db/migrate/20230110142344_backfill_friendly_id_slug_locale.rb
937
932
  - db/migrate/20230111121534_add_additional_taxon_translation_fields.rb
938
- - db/migrate/20230111122511_transfer_product_and_taxon_data_to_translatable_tables.rb
939
933
  - db/migrate/20230117115531_create_taxonomy_translations.rb
940
- - db/migrate/20230117120430_allow_null_taxonomy_name.rb
941
- - db/migrate/20230117121303_transfer_taxonomy_data_to_translatable_tables.rb
942
934
  - db/migrate/20230210142732_create_store_translations.rb
943
- - db/migrate/20230210142849_transfer_store_data_to_translatable_tables.rb
944
935
  - db/migrate/20230210230434_add_deleted_at_to_store_translations.rb
945
936
  - db/migrate/20230415155958_rename_data_feed_settings_table.rb
946
937
  - db/migrate/20230415160828_rename_data_feed_table_columns.rb
947
938
  - db/migrate/20230415161226_add_indexes_to_data_feeds_table.rb
948
939
  - db/migrate/20230512094803_rename_data_feeds_column_provider_to_type.rb
949
- - db/migrate/20230514162157_add_index_on_locale_and_permalink_to_spree_taxons.rb
940
+ - db/migrate/20240303174340_fix_spree_stock_item_unique_index.rb
941
+ - db/migrate/20240514105216_add_weight_and_dimension_units_to_spree_variants.rb
950
942
  - db/seeds.rb
951
943
  - lib/friendly_id/paranoia.rb
944
+ - lib/generators/spree/custom_authentication/custom_authentication_generator.rb
945
+ - lib/generators/spree/custom_authentication/templates/authentication_helpers.rb.tt
952
946
  - lib/generators/spree/custom_user/custom_user_generator.rb
953
- - lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt
947
+ - lib/generators/spree/custom_user/templates/current_user_helpers.rb.tt
954
948
  - lib/generators/spree/custom_user/templates/initializer.rb.tt
955
949
  - lib/generators/spree/custom_user/templates/migration.rb.tt
956
950
  - lib/generators/spree/dummy/dummy_generator.rb
@@ -989,6 +983,7 @@ files:
989
983
  - lib/spree/core/preferences/configuration.rb
990
984
  - lib/spree/core/preferences/preferable.rb
991
985
  - lib/spree/core/preferences/preferable_class_methods.rb
986
+ - lib/spree/core/preferences/runtime_configuration.rb
992
987
  - lib/spree/core/preferences/scoped_store.rb
993
988
  - lib/spree/core/preferences/store.rb
994
989
  - lib/spree/core/product_duplicator.rb
@@ -999,9 +994,11 @@ files:
999
994
  - lib/spree/core/query_filters/number.rb
1000
995
  - lib/spree/core/query_filters/text.rb
1001
996
  - lib/spree/core/routes.rb
997
+ - lib/spree/core/runtime_configuration.rb
1002
998
  - lib/spree/core/search/base.rb
1003
999
  - lib/spree/core/token_generator.rb
1004
1000
  - lib/spree/core/version.rb
1001
+ - lib/spree/core/webhooks.rb
1005
1002
  - lib/spree/database_type_utilities.rb
1006
1003
  - lib/spree/i18n.rb
1007
1004
  - lib/spree/localized_number.rb
@@ -1122,9 +1119,9 @@ licenses:
1122
1119
  - BSD-3-Clause
1123
1120
  metadata:
1124
1121
  bug_tracker_uri: https://github.com/spree/spree/issues
1125
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.7.2
1126
- documentation_uri: https://dev-docs.spreecommerce.org/
1127
- source_code_uri: https://github.com/spree/spree/tree/v4.7.2
1122
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.8.0
1123
+ documentation_uri: https://docs.spreecommerce.org/
1124
+ source_code_uri: https://github.com/spree/spree/tree/v4.8.0
1128
1125
  post_install_message:
1129
1126
  rdoc_options: []
1130
1127
  require_paths:
@@ -1,5 +0,0 @@
1
- class ChangeProductNameNullToTrue < ActiveRecord::Migration[6.1]
2
- def change
3
- change_column_null :spree_products, :name, true
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class ChangeTaxonNameNullToTrue < ActiveRecord::Migration[6.1]
2
- def change
3
- change_column_null :spree_taxons, :name, true
4
- end
5
- end
@@ -1,66 +0,0 @@
1
- class TransferDataToTranslatableTables < ActiveRecord::Migration[6.1]
2
- DEFAULT_LOCALE = 'en'
3
- PRODUCTS_TABLE = 'spree_products'
4
- PRODUCT_TRANSLATIONS_TABLE = 'spree_product_translations'
5
- TAXONS_TABLE = 'spree_taxons'
6
- TAXON_TRANSLATIONS_TABLE = 'spree_taxon_translations'
7
-
8
- def up
9
- # Products
10
- ActiveRecord::Base.connection.execute("
11
- INSERT INTO #{PRODUCT_TRANSLATIONS_TABLE} (name, description, locale, spree_product_id, created_at, updated_at, meta_description, meta_keywords, meta_title, slug)
12
- SELECT name, description, '#{DEFAULT_LOCALE}' as locale, id, created_at, updated_at, meta_description, meta_keywords, meta_title, slug FROM #{PRODUCTS_TABLE}
13
- ")
14
- ActiveRecord::Base.connection.execute("
15
- UPDATE #{PRODUCTS_TABLE}
16
- SET name=null, description=null, meta_description=null, meta_keywords=null, meta_title=null, slug=null;
17
- ")
18
- #Taxons
19
- ActiveRecord::Base.connection.execute("
20
- INSERT INTO #{TAXON_TRANSLATIONS_TABLE} (name, description, locale, spree_taxon_id, created_at, updated_at)
21
- SELECT name, description, '#{DEFAULT_LOCALE}' as locale, id, created_at, updated_at FROM #{TAXONS_TABLE}
22
- ")
23
- ActiveRecord::Base.connection.execute("
24
- UPDATE #{TAXONS_TABLE}
25
- SET name=null, description=null
26
- ")
27
- end
28
-
29
- def down
30
- ActiveRecord::Base.connection.execute("
31
- UPDATE #{PRODUCTS_TABLE} as products
32
- SET (name,
33
- description,
34
- meta_description,
35
- meta_keywords,
36
- meta_title,
37
- slug) =
38
- (t_products.name,
39
- t_products.description,
40
- t_products.meta_description,
41
- t_products.meta_keywords,
42
- t_products.meta_title,
43
- t_products.slug)
44
- FROM #{PRODUCT_TRANSLATIONS_TABLE} AS t_products
45
- WHERE t_products.spree_product_id = products.id
46
- ")
47
-
48
- ActiveRecord::Base.connection.execute("
49
- TRUNCATE TABLE #{PRODUCT_TRANSLATIONS_TABLE}
50
- ")
51
-
52
- ActiveRecord::Base.connection.execute("
53
- UPDATE #{TAXONS_TABLE} as taxons
54
- SET (name,
55
- description) =
56
- (t_taxons.name,
57
- t_taxons.description)
58
- FROM #{TAXON_TRANSLATIONS_TABLE} AS t_taxons
59
- WHERE t_taxons.spree_taxon_id = taxons.id
60
- ")
61
-
62
- ActiveRecord::Base.connection.execute("
63
- TRUNCATE TABLE #{TAXON_TRANSLATIONS_TABLE}
64
- ")
65
- end
66
- end
@@ -1,58 +0,0 @@
1
- class TransferOptionsDataToTranslatableTables < ActiveRecord::Migration[6.1]
2
- DEFAULT_LOCALE = 'en'
3
-
4
- def up
5
- # Only transfer data if translation tables are being newly created / no translations exist
6
- # Otherwise, assume translation data is already in place from spree_globalize
7
-
8
- # Option Types
9
- if not Spree::OptionType::Translation.exists?
10
- ActiveRecord::Base.connection.execute("
11
- INSERT INTO spree_option_type_translations (name, presentation, locale, spree_option_type_id, created_at, updated_at)
12
- SELECT name, presentation, '#{DEFAULT_LOCALE}', id, created_at, updated_at
13
- FROM spree_option_types;
14
- ")
15
- ActiveRecord::Base.connection.execute("
16
- UPDATE spree_option_types
17
- SET name=null, presentation=null;
18
- ")
19
- end
20
-
21
- # Option Values
22
- if not Spree::OptionValue::Translation.exists?
23
- ActiveRecord::Base.connection.execute("
24
- INSERT INTO spree_option_value_translations (name, presentation, locale, spree_option_value_id, created_at, updated_at)
25
- SELECT name, presentation, '#{DEFAULT_LOCALE}', id, created_at, updated_at
26
- FROM spree_option_values;
27
- ")
28
- ActiveRecord::Base.connection.execute("
29
- UPDATE spree_option_values
30
- SET name=null, presentation=null;
31
- ")
32
- end
33
- end
34
-
35
- def down
36
- # Option Types
37
- ActiveRecord::Base.connection.execute("
38
- UPDATE spree_option_types as option_types
39
- SET (name, presentation) = (t_option_types.name, t_option_types.presentation)
40
- FROM spree_option_type_translations AS t_option_types
41
- WHERE t_option_types.spree_option_type_id = option_types.id;
42
- ")
43
- ActiveRecord::Base.connection.execute("
44
- TRUNCATE TABLE spree_option_type_translations;
45
- ")
46
-
47
- # Option Values
48
- ActiveRecord::Base.connection.execute("
49
- UPDATE spree_option_values as option_values
50
- SET (name, presentation) = (t_option_values.name, t_option_values.presentation)
51
- FROM spree_option_value_translations AS t_option_values
52
- WHERE t_option_values.spree_option_value_id = option_values.id;
53
- ")
54
- ActiveRecord::Base.connection.execute("
55
- TRUNCATE TABLE spree_option_value_translations;
56
- ")
57
- end
58
- end