spree_frontend 4.0.2 → 4.0.7

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: 045eb2eddb62a9f828123579bfef6ccd086d33c26c2ba96c235839b1da07e1ed
4
- data.tar.gz: 880d2fc21eaa4997177228a65267fc3217532be74fa900d4ea6e2f36ac64110c
3
+ metadata.gz: 40f833281268f78b47529602a5ab619e37374653f0a8f2dea323d7f5d2798ce4
4
+ data.tar.gz: f073a3943b5643fcf639b99dd3bda73a1e27c9b325eb042b2b4a11580d1ae886
5
5
  SHA512:
6
- metadata.gz: 4d53ed8bed911e73478cebf8cf8b0c2bbaff921c6048b0f29a4b537fc1ef60e9351da3c15065f4703cb0558527da192e309f53f8687a4fcb216043f76200f7ad
7
- data.tar.gz: bc9e689ea09d61be82ef7d7a862e37e0c0ba89c013fa6bfde78bfd84908d7fc02f79a742f0ef044164b67ecc07630fdede182e5f98234a36bb1951d41b7ed9b6
6
+ metadata.gz: d2a813760c3afdcaac0e875c1cc3bc30f2d827a33ea5e785d3e953092102b04552e699487578f80619aa23a2265dd1d6031b2e93fc0b264969d5e50a061401f4
7
+ data.tar.gz: d9f7d63f5c2f69ab904362f3442f826313ad7308bed6061c951c1028d862cf0d79ce48b27abc014e08cf3b3cff4e155afa60a70a81c0fdb3c56242e4dae70b63
@@ -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.2
4
+ version: 4.0.7
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: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2021-03-05 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.2
19
+ version: 4.0.7
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.2
26
+ version: 4.0.7
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.2
33
+ version: 4.0.7
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.2
40
+ version: 4.0.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -250,8 +250,12 @@ files:
250
250
  homepage: http://spreecommerce.org
251
251
  licenses:
252
252
  - BSD-3-Clause
253
- metadata: {}
254
- post_install_message:
253
+ metadata:
254
+ bug_tracker_uri: https://github.com/spree/spree/issues
255
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.0.7
256
+ documentation_uri: https://guides.spreecommerce.org/
257
+ source_code_uri: https://github.com/spree/spree/tree/v4.0.7
258
+ post_install_message:
255
259
  rdoc_options: []
256
260
  require_paths:
257
261
  - lib
@@ -267,8 +271,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
271
  version: '0'
268
272
  requirements:
269
273
  - none
270
- rubygems_version: 3.0.2
271
- signing_key:
274
+ rubygems_version: 3.2.3
275
+ signing_key:
272
276
  specification_version: 4
273
277
  summary: Frontend e-commerce functionality for the Spree project.
274
278
  test_files: []