spree_core 5.2.6 → 5.2.7

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: 4e0552e5475aa54e072158a70ea648d02d5514550eca293f1c0e0c79554c4216
4
- data.tar.gz: afe49cf6d48fa819396d1518e3531435ffc22d038ce1a75aef430082bbc429fb
3
+ metadata.gz: 729147132263dcf0c7d05f60e13fa6aeaa24a38625a5ef2cf9c749f1791c238c
4
+ data.tar.gz: 9493863773080c567924e9d8615b9741c4412f73857f05070a865ac53ff294a6
5
5
  SHA512:
6
- metadata.gz: 46b12717f12408f073b31a2a4f70d8850204bcfd59d32b20a6d891bc0326b7ea0c563c9b876e81156c6ba40f6ba88705553f87bc349598f52e8d761a7ea887a7
7
- data.tar.gz: 37e34cbc4020055babe24354344aae7306dde8343267b2bac666fe691881936e5ebf6daeaa982ad4ce1ea4df88eecc77cb168c5321c57c2329b920dba37d05d7
6
+ metadata.gz: a7394275107208ee5f2a30b065cf9a8e131355d440b74dcc7fd95fe9d2114462f578a3c9722121d826bfa2458f4543b7e8933d477abcca4e05404175d293ea13
7
+ data.tar.gz: f1168bd875c177d05a28d515488d8f0dcb0abe88749279d8c07837bf9d7e53526887e85ccfca9b1dc1322122ee95c6b43ad3955297a207e9d784a606bce0b723
@@ -14,13 +14,17 @@ module Spree
14
14
  end
15
15
 
16
16
  def bill_address_id=(id)
17
+ return if bill_address_id == id
18
+
17
19
  address = Spree::Address.find_by(id: id)
18
- if address && address.user_id == user_id
20
+ # rubocop:disable Style/ConditionalAssignment
21
+ if address && user_id.present? && address.user_id == user_id
19
22
  self['bill_address_id'] = address.id
20
- bill_address.reload
21
23
  else
22
24
  self['bill_address_id'] = nil
23
25
  end
26
+ # rubocop:enable Style/ConditionalAssignment
27
+ reset_bill_address
24
28
  end
25
29
 
26
30
  def bill_address_attributes=(attributes)
@@ -29,13 +33,17 @@ module Spree
29
33
  end
30
34
 
31
35
  def ship_address_id=(id)
36
+ return if ship_address_id == id
37
+
32
38
  address = Spree::Address.find_by(id: id)
33
- if address && address.user_id == user_id
39
+ # rubocop:disable Style/ConditionalAssignment
40
+ if address && user_id.present? && address.user_id == user_id
34
41
  self['ship_address_id'] = address.id
35
- ship_address.reload
36
42
  else
37
43
  self['ship_address_id'] = nil
38
44
  end
45
+ # rubocop:enable Style/ConditionalAssignment
46
+ reset_ship_address
39
47
  end
40
48
 
41
49
  def ship_address_attributes=(attributes)
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '5.2.6'.freeze
2
+ VERSION = '5.2.7'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.6
4
+ version: 5.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -1704,9 +1704,9 @@ licenses:
1704
1704
  - BSD-3-Clause
1705
1705
  metadata:
1706
1706
  bug_tracker_uri: https://github.com/spree/spree/issues
1707
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.6
1707
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.7
1708
1708
  documentation_uri: https://docs.spreecommerce.org/
1709
- source_code_uri: https://github.com/spree/spree/tree/v5.2.6
1709
+ source_code_uri: https://github.com/spree/spree/tree/v5.2.7
1710
1710
  rdoc_options: []
1711
1711
  require_paths:
1712
1712
  - lib