spree_core 4.1.7 → 4.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9abe56060f0568926e082bc13e3984b3819c23f5e5658b14ff58e44589a9e51
4
- data.tar.gz: ca29391589cf6bf06c8f20bfb248be16fae419b3fb683255803f01a355f0ddac
3
+ metadata.gz: 5fc843401beee13a77c3d23fa5fceacc0465b7c20ecd76068666703e4d7addd5
4
+ data.tar.gz: 31a3220b19ff45d6495c4929024c6c10d9d8d1da78498914960d21ab75a63e6f
5
5
  SHA512:
6
- metadata.gz: e2aea90e9694d9b2ac45d23e7a5ea5fd07bc25a7ba93a614328f740857c8c10b6c6d644ff3bc258c3a600f3ae8836e6ad5b1d9473799ffc1c672e7878afd3ff3
7
- data.tar.gz: 423b46182c0785e1915315afa475f0125f9d832fcab13ff34abc83f7628681d24d555cc6513b4338c8f282b40f833825b8015502b73162946f908e6535ad5b46
6
+ metadata.gz: 61f76f5ba5be894e74d09b68ee7d8b797a9bcd62f10607c442a4009089cfe3170a0846a5711b03fa7522c7de85a9e0db00b22bd502ae39a651ffbf1544d84d33
7
+ data.tar.gz: 90c8b7435675640ffaaca1bb635bd7a929b54197973c79226f333196caf44a044e1bc821c47ddc3f6f8ce84ebb6522f9b07f76855aa45550e0f69cd5ab8e23ed
@@ -44,6 +44,7 @@ module Spree
44
44
  preference :company, :boolean, default: false # Request company field for billing and shipping addr
45
45
  preference :currency, :string, default: 'USD'
46
46
  preference :default_country_id, :integer
47
+ preference :disable_sku_validation, :boolean, default: false # when turned off disables the built-in SKU uniqueness validation
47
48
  preference :expedited_exchanges, :boolean, default: false # NOTE this requires payment profiles to be supported on your gateway of choice as well as a delayed job handler to be configured with activejob. kicks off an exchange shipment upon return authorization save. charge customer if they do not return items within timely manner.
48
49
  preference :expedited_exchanges_days_window, :integer, default: 14 # the amount of days the customer has to return their item after the expedited exchange is shipped in order to avoid being charged
49
50
  preference :layout, :string, default: 'spree/layouts/spree_application'
@@ -48,7 +48,8 @@ module Spree
48
48
  validates :cost_price
49
49
  validates :price
50
50
  end
51
- validates :sku, uniqueness: { conditions: -> { where(deleted_at: nil) }, case_sensitive: false }, allow_blank: true
51
+ validates :sku, uniqueness: { conditions: -> { where(deleted_at: nil) }, case_sensitive: false },
52
+ allow_blank: true, unless: :disable_sku_validation?
52
53
 
53
54
  after_create :create_stock_items
54
55
  after_create :set_master_out_of_stock, unless: :is_master?
@@ -324,5 +325,9 @@ module Spree
324
325
  def clear_in_stock_cache
325
326
  Rails.cache.delete(in_stock_cache_key)
326
327
  end
328
+
329
+ def disable_sku_validation?
330
+ Spree::Config[:disable_sku_validation]
331
+ end
327
332
  end
328
333
  end
@@ -7,9 +7,7 @@ module Spree
7
7
  run :reload_order
8
8
  run :ensure_shipping_address
9
9
  run :ensure_line_items_present
10
- run :move_order_to_delivery_state
11
- run :generate_shipping_rates
12
- run :return_shipments
10
+ run :generate_or_return_shipping_rates
13
11
  end
14
12
 
15
13
  private
@@ -31,6 +29,11 @@ module Spree
31
29
  success(order: order)
32
30
  end
33
31
 
32
+ def generate_or_return_shipping_rates(order:)
33
+ generate_shipping_rates(order: order) if order.shipments.empty?
34
+ return_shipments(order: order)
35
+ end
36
+
34
37
  def generate_shipping_rates(order:)
35
38
  ApplicationRecord.transaction do
36
39
  order.create_proposed_shipments
@@ -42,13 +45,7 @@ module Spree
42
45
  end
43
46
 
44
47
  def return_shipments(order:)
45
- success(order.shipments.includes([shipping_rates: :shipping_method]))
46
- end
47
-
48
- def move_order_to_delivery_state(order:)
49
- Spree::Dependencies.checkout_next_service.constantize.call(order: order) until order.state == 'delivery'
50
-
51
- success(order: order)
48
+ success(order.reload.shipments.includes([shipping_rates: :shipping_method]))
52
49
  end
53
50
  end
54
51
  end
@@ -26,5 +26,6 @@ Spree.dependencies do |dependencies|
26
26
  # dependencies.cart_add_item_service = 'MyNewAwesomeService'
27
27
  end
28
28
 
29
+ # Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer'
29
30
 
30
31
  Spree.user_class = <%= (options[:user_class].blank? ? 'Spree::LegacyUser' : options[:user_class]).inspect %>
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '4.1.7'
3
+ '4.1.8'
4
4
  end
5
5
  end
@@ -6,17 +6,23 @@ Gem::Specification.new do |s|
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.name = 'spree_core'
8
8
  s.version = Spree.version
9
+ s.author = 'Sean Schofield'
10
+ s.email = 'sean@spreecommerce.com'
9
11
  s.summary = 'The bare bones necessary for Spree.'
10
12
  s.description = 'The bare bones necessary for Spree.'
13
+ s.homepage = 'http://spreecommerce.org'
14
+ s.license = 'BSD-3-Clause'
15
+
16
+ s.metadata = {
17
+ "bug_tracker_uri" => "https://github.com/spree/spree/issues",
18
+ "changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
19
+ "documentation_uri" => "https://guides.spreecommerce.org/",
20
+ "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
21
+ }
11
22
 
12
23
  s.required_ruby_version = '>= 2.5.0'
13
24
  s.required_rubygems_version = '>= 1.8.23'
14
25
 
15
- s.author = 'Sean Schofield'
16
- s.email = 'sean@spreecommerce.com'
17
- s.homepage = 'http://spreecommerce.org'
18
- s.license = 'BSD-3-Clause'
19
-
20
26
  s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
21
27
  s.require_path = 'lib'
22
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.7
4
+ version: 4.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2020-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -1083,8 +1083,12 @@ files:
1083
1083
  homepage: http://spreecommerce.org
1084
1084
  licenses:
1085
1085
  - BSD-3-Clause
1086
- metadata: {}
1087
- post_install_message:
1086
+ metadata:
1087
+ bug_tracker_uri: https://github.com/spree/spree/issues
1088
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.1.8
1089
+ documentation_uri: https://guides.spreecommerce.org/
1090
+ source_code_uri: https://github.com/spree/spree/tree/v4.1.8
1091
+ post_install_message:
1088
1092
  rdoc_options: []
1089
1093
  require_paths:
1090
1094
  - lib
@@ -1100,7 +1104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1100
1104
  version: 1.8.23
1101
1105
  requirements: []
1102
1106
  rubygems_version: 3.1.2
1103
- signing_key:
1107
+ signing_key:
1104
1108
  specification_version: 4
1105
1109
  summary: The bare bones necessary for Spree.
1106
1110
  test_files: []