solidus_core 3.3.0 → 3.3.2

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: 6b882356a483b6ec07df20020cfdf2429122ed885165c9626384017479b26442
4
- data.tar.gz: a840c6d60aab4097f5159588a9b648ac5baac0fba6704ea21e1928eb7dc1dd88
3
+ metadata.gz: caace905606e0421dddde4e2092959bc15679b45d4fd6f71202aca8ac9b22cca
4
+ data.tar.gz: d0076132f422409dbfc7754d68cfc5d1dd72165429ce1ee2c5cbf7e6a7aa78e6
5
5
  SHA512:
6
- metadata.gz: fdcc5ba0f68af828dd0d0908c55e4f69fdf14b7ca12ad80ad63d0083c73a49924a3d575ddc60ab3786c240faa120f1543aafbeed01c037e7246161d129d2bb0b
7
- data.tar.gz: fae363d934fae8f8bbfcb26ce5f9187984c4e1094c11d43ad9e3f956f0682414d284195f13e390cda73bd4791dfe8ea8ab2e81ef71a8831300b0d5b39beaabe3
6
+ metadata.gz: 30d1a926a99a01a2610f0f87a7eaf6881693fd1bb0f449d795e3ba147e88e3bbab335aa47a0efc981eaec818e7820cc81a74d1bb21888c25bf656f01b4604cc7
7
+ data.tar.gz: b4f85d2275a4b1823411f9d592f5d5c2acf13b47d137b34e9f15733114cda5280c79d243a5deaa89994b7a5cdcf5cf4fafcf40e9a01e276094257e7c2e26c233
@@ -32,6 +32,12 @@ module Spree
32
32
  prices.build(self.class.default_price_attributes)
33
33
  end
34
34
 
35
+ # @deprecated Use {#default_price_or_build} instead.
36
+ def find_or_build_default_price
37
+ default_price_or_build
38
+ end
39
+ deprecate find_or_build_default_price: :default_price_or_build, deprecator: Spree::Deprecation
40
+
35
41
  # Select from {#prices} the one to be considered as the default
36
42
  #
37
43
  # This method works with the in-memory association, so non-persisted prices
@@ -83,6 +83,7 @@ module Spree
83
83
  :height,
84
84
  :price,
85
85
  :sku,
86
+ :track_inventory,
86
87
  :weight,
87
88
  :width,
88
89
  ]
@@ -1,3 +1,3 @@
1
1
  apply "#{__dir__}/break_down_solidus_gem.rb"
2
2
  run_bundle
3
- apply 'https://github.com/solidusio/solidus_starter_frontend/raw/main/template.rb'
3
+ apply 'https://github.com/solidusio/solidus_starter_frontend/raw/v3.3/template.rb'
@@ -8,7 +8,7 @@ module Solidus
8
8
  class UpdateGenerator < ::Rails::Generators::Base
9
9
  FROM = Spree.previous_solidus_minor_version
10
10
 
11
- desc 'Generates a new initializer to preview the new defaults for current Solidus version'
11
+ desc 'Generates a new initializer to preview the new defaults for current Solidus version and copy new migrations'
12
12
 
13
13
  source_root File.expand_path('templates', __dir__)
14
14
 
@@ -37,10 +37,15 @@ module Solidus
37
37
  default: 'config/initializers/',
38
38
  hide: true
39
39
 
40
+ class_option :install_migrations,
41
+ type: :boolean,
42
+ default: true,
43
+ hide: true
44
+
40
45
  def create_new_defaults_initializer
41
46
  previous_version_prompt = options[:previous_version_prompt]
42
47
  return if previous_version_prompt && !yes?(<<~MSG, :red)
43
- The update process is only supported if you are coming from version #{FROM}. If this is not the case, please, skip it and update your application to use Solidus #{FROM} before retrying.
48
+ The default preferences update process is only supported if you are coming from version #{FROM}. If this is not the case, please, skip it and update your application to use Solidus #{FROM} before retrying.
44
49
  If you are confident you want to upgrade from a previous version, you must rerun the generator with the "--from={OLD_VERSION}" argument.
45
50
  Are you sure you want to continue? (y/N)
46
51
  MSG
@@ -57,6 +62,13 @@ module Solidus
57
62
  File.join(options[:initializer_directory], "#{options[:initializer_basename]}.rb")
58
63
  end
59
64
 
65
+ def install_migrations
66
+ return unless options[:install_migrations]
67
+
68
+ say_status :copying, "migrations"
69
+ rake 'spree:install:migrations'
70
+ end
71
+
60
72
  def print_message
61
73
  say <<~MSG
62
74
 
data/lib/spree/bus.rb CHANGED
@@ -9,12 +9,12 @@ module Spree
9
9
  # It has some modifications to support internal usage of the legacy event
10
10
  # system {see Spree::AppConfiguration#use_legacy_events}.
11
11
  Bus = Omnes::Bus.new
12
- Bus.define_singleton_method(:publish) do |*args, **kwargs, &block|
12
+ def Bus.publish(event, **kwargs)
13
13
  if Spree::Config.use_legacy_events
14
- Spree::Event.fire(*args, **kwargs, &block)
14
+ Spree::Event.fire(event, **kwargs)
15
15
  else
16
16
  # Override caller_location to point to the actual event publisher
17
- super(*args, **kwargs, caller_location: caller_locations(1)[0], &block)
17
+ super(event, **kwargs, caller_location: caller_locations(1)[0])
18
18
  end
19
19
  end
20
20
  end
@@ -45,7 +45,7 @@ module Spree
45
45
  new_master.sku = "COPY OF #{master.sku}"
46
46
  new_master.deleted_at = nil
47
47
  new_master.images = master.images.map { |image| duplicate_image image } if @include_images
48
- new_master.price = master.price
48
+ new_master.prices = master.prices.map(&:dup)
49
49
  end
50
50
  end
51
51
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "3.3.0"
4
+ VERSION = "3.3.2"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION
@@ -90,7 +90,7 @@ module DummyApp
90
90
  config.active_record.dump_schema_after_migration = false
91
91
 
92
92
  # Configure active storage to use storage within tmp folder
93
- unless ENV['DISABLE_ACTIVE_STORAGE']
93
+ unless (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
94
94
  initializer 'solidus.active_storage' do
95
95
  config.active_storage.service_configurations = {
96
96
  test: {
@@ -138,9 +138,9 @@ end
138
138
  Spree.user_class = 'Spree::LegacyUser'
139
139
  Spree.load_defaults(Spree.solidus_version)
140
140
  Spree.config do |config|
141
- config.use_legacy_events = ENV['USE_LEGACY_EVENTS'].present?
141
+ config.use_legacy_events = (ENV['USE_LEGACY_EVENTS'] == 'true')
142
142
 
143
- if ENV['DISABLE_ACTIVE_STORAGE']
143
+ if (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
144
144
  config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
145
145
  config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment'
146
146
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-24 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -1034,7 +1034,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1034
1034
  - !ruby/object:Gem::Version
1035
1035
  version: 1.8.23
1036
1036
  requirements: []
1037
- rubygems_version: 3.3.26
1037
+ rubygems_version: 3.4.6
1038
1038
  signing_key:
1039
1039
  specification_version: 4
1040
1040
  summary: Essential models, mailers, and classes for the Solidus e-commerce project.