solidus_core 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23a2ea44528d022e92a2e20276022fc71a8870a7b51502dcfcd441e31789606a
4
- data.tar.gz: ca5d3d936f3e8517aecf63b458e40800fb16f4c0d6f434e90e8e3f8c0d21a030
3
+ metadata.gz: ca6d8d275b71868fa0cbcfd87ea5c540ed14c4db6908e90192012889adc936b9
4
+ data.tar.gz: b9333bbde0b2634d590a9021d2b4c4a2cb398a25099254947b870f94ff0d5992
5
5
  SHA512:
6
- metadata.gz: f61253c30c143c442ff677c483119cf9831aceadde9179dd7aec8247d32d0bbb776b300387966eeaac36df7fb00ea439ebab025321426f8d465469b6d5dec1c3
7
- data.tar.gz: 0b2e62a6323d33962f9019399a62a47944d9f2698ca3b7c6d725a70d66a5fdab47def7960428a9d4586d65b1a7421f26eefe3948c122fc7c1ce47a8f57e8ab07
6
+ metadata.gz: c56f0af4fbd26a4d486aaeb170d6554d256a7265a33a0a515150822dc8aefa1369e7e4ce8b3e3b60ea2a32318b9f03d9f214d18c6014ff248649d3867cc83a0b
7
+ data.tar.gz: acc8a07396946a959ebda8e0c7953eb7cb6ac656a7e91debd6e0159d0c7a6e896f0406d226fd3e28d6776999fc9797938010cdb952bea32ae819cdd64f435b4e
@@ -490,7 +490,7 @@ module Spree
490
490
  raise CannotRebuildShipments.new(I18n.t('spree.cannot_rebuild_shipments_shipments_not_pending'))
491
491
  else
492
492
  shipments.destroy_all
493
- self.shipments = Spree::Config.stock.coordinator_class.new(self).shipments
493
+ shipments.push(*Spree::Config.stock.coordinator_class.new(self).shipments)
494
494
  end
495
495
  end
496
496
 
@@ -45,7 +45,6 @@ module Spree
45
45
 
46
46
  has_many :variants,
47
47
  -> { where(is_master: false).order(:position) },
48
- inverse_of: :product,
49
48
  class_name: 'Spree::Variant'
50
49
 
51
50
  has_many :variants_including_master,
@@ -254,10 +254,9 @@ module Spree
254
254
  }).where.not(id: id).first
255
255
 
256
256
  if other_return_item && (new_record? || COMPLETED_RECEPTION_STATUSES.include?(reception_status.to_sym))
257
- errors.add(:inventory_unit, :other_completed_return_item_exists, {
257
+ errors.add(:inventory_unit, :other_completed_return_item_exists,
258
258
  inventory_unit_id: inventory_unit_id,
259
- return_item_id: other_return_item.id
260
- })
259
+ return_item_id: other_return_item.id)
261
260
  end
262
261
  end
263
262
 
@@ -73,11 +73,16 @@ module Spree
73
73
  packages = split_packages(packages)
74
74
 
75
75
  # Turn the Stock::Packages into a Shipment with rates
76
- packages.map do |package|
76
+ shipments = packages.map do |package|
77
77
  shipment = package.shipment = package.to_shipment
78
78
  shipment.shipping_rates = Spree::Config.stock.estimator_class.new.shipping_rates(package)
79
79
  shipment
80
80
  end
81
+
82
+ # Make sure we don't add the proposed shipments to the order
83
+ order.shipments = order.shipments - shipments
84
+
85
+ shipments
81
86
  end
82
87
 
83
88
  def split_packages(initial_packages)
@@ -30,7 +30,7 @@ module Spree
30
30
  attr_writer :rebuild_vat_prices
31
31
  include Spree::DefaultPrice
32
32
 
33
- belongs_to :product, -> { with_discarded }, touch: true, class_name: 'Spree::Product', inverse_of: :variants, optional: false
33
+ belongs_to :product, -> { with_discarded }, touch: true, class_name: 'Spree::Product', inverse_of: :variants_including_master, optional: false
34
34
  belongs_to :tax_category, class_name: 'Spree::TaxCategory', optional: true
35
35
 
36
36
  delegate :name, :description, :slug, :available_on, :discontinue_on, :discontinued?,
@@ -16,7 +16,7 @@ module Spree
16
16
 
17
17
  def validate_each(record, attribute, value)
18
18
  unless EMAIL_REGEXP.match? value
19
- record.errors.add(attribute, :invalid, { value: value }.merge!(options))
19
+ record.errors.add(attribute, :invalid, **{ value: value }.merge!(options))
20
20
  end
21
21
  end
22
22
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "3.0.1"
4
+ VERSION = "3.0.2"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION
@@ -51,7 +51,13 @@ module Spree
51
51
  :month, :year, :expiry, :first_name, :last_name, :name
52
52
  ]
53
53
 
54
- @@customer_return_attributes = [:stock_location_id, return_items_attributes: [:id, :inventory_unit_id, :return_authorization_id, :returned, :amount, :reception_status_event, :acceptance_status, :exchange_variant_id, :resellable]]
54
+ @@customer_return_attributes = [
55
+ :stock_location_id, return_items_attributes: [
56
+ :id, :inventory_unit_id, :return_authorization_id, :returned, :amount,
57
+ :reception_status_event, :acceptance_status, :exchange_variant_id,
58
+ :resellable, :return_reason_id
59
+ ]
60
+ ]
55
61
 
56
62
  @@image_attributes = [:alt, :attachment, :position, :viewable_type, :viewable_id]
57
63
 
@@ -46,6 +46,7 @@ module DummyApp
46
46
  end
47
47
 
48
48
  class Application < ::Rails::Application
49
+ config.has_many_inverse = true
49
50
  config.eager_load = false
50
51
  config.cache_classes = true
51
52
  config.cache_store = :memory_store
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.0.1
4
+ version: 3.0.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: 2021-05-10 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -944,7 +944,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
944
944
  - !ruby/object:Gem::Version
945
945
  version: 1.8.23
946
946
  requirements: []
947
- rubygems_version: 3.1.4
947
+ rubygems_version: 3.2.20
948
948
  signing_key:
949
949
  specification_version: 4
950
950
  summary: Essential models, mailers, and classes for the Solidus e-commerce project.