spree_frontend 4.0.5 → 4.0.6

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: 4c86b5938d88512e6620a78ea5fcc24c62e7dbad166c1c2656fb0b09c155a402
4
- data.tar.gz: 7ce03756b78b0d3c34e5b32422c101c389f8f6204918effd92b760d6f5884c57
3
+ metadata.gz: e3b3b838174beb5d16c333196eaf39c8c8eb676646aa0b710787d22702f203b3
4
+ data.tar.gz: 1b1268f3ea48e8b0ec998499e8044a57eb0df163b2f365e9c7acf2ca9b5f880d
5
5
  SHA512:
6
- metadata.gz: 635be86a1a09830564d3ad2a4f82a34c1c6cc3f6c851ae30a60d8dea437f2117e9c164ec1bdb1f63faa98c92e9104cd8400787d28e276d045dea6960516037dc
7
- data.tar.gz: c316e5456bea6102b24b23d569a2920956a275bd4215318ab5e48cadff85bf570332640ba4ee2da1c9a9821752e6d8d17583d8371e878f9912bdfb1dafa4c6bc
6
+ metadata.gz: 25aa71428a0e8cdfb54de456f3b6ad87ec6d62c2a1cee8e1f3426d9354bf38b3648d61b1078131457e8fc63e4a0df7216dc2ef16806508fe43b37b003550a567
7
+ data.tar.gz: fcbbe9cf25c765ced64728e7d41c829b2b888080b09b82c3697411f6e50fe06690dbecd54bfc9a3e9f7dc2371572b6b60e3108f8b7874ad50aeb6c6ffd668f5d
@@ -32,21 +32,23 @@ module Spree
32
32
  end
33
33
 
34
34
  def normalize_addresses
35
- return unless params[:state] == 'address' && @order.bill_address_id && @order.ship_address_id
35
+ return unless params[:state] == 'address' && @order.bill_address_id
36
36
 
37
- # ensure that there is no validation errors and addresses were saved
38
- return unless @order.bill_address && @order.ship_address
37
+ if @order.checkout_steps.include?('delivery')
38
+ return unless @order.ship_address_id
39
+ end
39
40
 
40
41
  bill_address = @order.bill_address
41
42
  ship_address = @order.ship_address
43
+
44
+ if params[:save_user_address].present? && try_spree_current_user.present?
45
+ [bill_address, ship_address].each { |address| address&.update_attribute(:user_id, try_spree_current_user&.id) }
46
+ end
47
+
42
48
  if @order.bill_address_id != @order.ship_address_id && bill_address == ship_address
43
49
  @order.update_column(:bill_address_id, ship_address.id)
44
50
  bill_address.destroy
45
- elsif params[:save_user_address]
46
- bill_address.update_attribute(:user_id, try_spree_current_user&.id)
47
51
  end
48
-
49
- ship_address.update_attribute(:user_id, try_spree_current_user&.id) if params[:save_user_address]
50
52
  end
51
53
  end
52
54
  end
@@ -37,6 +37,7 @@ module Spree
37
37
  else
38
38
  new_address = @address.clone
39
39
  new_address.attributes = address_params
40
+ new_address.user_id = @address.user_id
40
41
  @address.update_attribute(:deleted_at, Time.current)
41
42
  if new_address.save
42
43
  flash[:notice] = Spree.t(:successfully_updated, scope: :address_book)
@@ -5,16 +5,22 @@ Gem::Specification.new do |s|
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.name = 'spree_frontend'
7
7
  s.version = Spree.version
8
- s.summary = 'Frontend e-commerce functionality for the Spree project.'
9
- s.description = s.summary
10
-
11
- s.required_ruby_version = '>= 2.5.0'
12
-
13
8
  s.author = 'Sean Schofield'
14
9
  s.email = 'sean@spreecommerce.com'
10
+ s.summary = 'Frontend e-commerce functionality for the Spree project.'
11
+ s.description = s.summary
15
12
  s.homepage = 'http://spreecommerce.org'
16
13
  s.license = 'BSD-3-Clause'
17
14
 
15
+ s.metadata = {
16
+ "bug_tracker_uri" => "https://github.com/spree/spree/issues",
17
+ "changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
18
+ "documentation_uri" => "https://guides.spreecommerce.org/",
19
+ "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
20
+ }
21
+
22
+ s.required_ruby_version = '>= 2.5.0'
23
+
18
24
  s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
19
25
  s.require_path = 'lib'
20
26
  s.requirements << 'none'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-10 00:00:00.000000000 Z
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.5
19
+ version: 4.0.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.5
26
+ version: 4.0.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.0.5
33
+ version: 4.0.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.0.5
40
+ version: 4.0.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -250,7 +250,11 @@ files:
250
250
  homepage: http://spreecommerce.org
251
251
  licenses:
252
252
  - BSD-3-Clause
253
- metadata: {}
253
+ metadata:
254
+ bug_tracker_uri: https://github.com/spree/spree/issues
255
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.0.6
256
+ documentation_uri: https://guides.spreecommerce.org/
257
+ source_code_uri: https://github.com/spree/spree/tree/v4.0.6
254
258
  post_install_message:
255
259
  rdoc_options: []
256
260
  require_paths: