spree_backend 4.8.0 → 4.8.1

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: 3300d2767c8c33fab939d5c7c30dd41db56d9c422469820f8eaeef2bcf71ba6e
4
- data.tar.gz: 745fb617eed98c7268c185eddc32eab136e6067624b712fbd85f9c777b520bbe
3
+ metadata.gz: 50d15f557484b7de4678567d9efafbc222c0b1a5693520b5a3fb4c54cca2d3dc
4
+ data.tar.gz: 07a69c4b34ca20c724c489b1cb8082c77b338d823d4f68a06629184d4243620a
5
5
  SHA512:
6
- metadata.gz: e291674023a82d06681356deeffcfe747da3450e835f6fbbd7ca81be1782bc54be59471a9bf1040ea2ee0b685a30f7a2a2e20cda76d1c6a7b5c8b1016f797f0c
7
- data.tar.gz: 27ca5a00563290b6523fa8ff3bcc73f00c8e4a250c319942e15f556c129021603f0555003603ac68f93e196b04cbb45b8dfb11f1ed619d5f3b814cc3c0edaaf7
6
+ metadata.gz: 017da7b314df0c609a0cd1791fcddcfe805e4a02bd83629ad0ffb1339e95808d1b914dd592d2e227d4b9f496069ba48d700845c5d0ee39f197966c3d1c4c33df
7
+ data.tar.gz: 69bcb32c1983d1d2d623915dd50134f52d626369bd422516fa504fb5e3e1a20f6f1db971b9228a22da3be99da5779a62221e0dda815550e9c26e1921ef99bd5a
@@ -20,13 +20,26 @@ module Spree
20
20
  locales_to_update = current_store_locales & params_locales
21
21
 
22
22
  locales_to_update.each do |locale|
23
- translation = @object.translations.find_or_initialize_by(locale: locale)
24
- translation_params.each do |attribute, translations|
25
- translation.public_send("#{attribute}=", translations[locale])
23
+ if update_translation_value?(locale)
24
+ translation = @object.translations.find_or_initialize_by(locale: locale)
25
+ translation_params.each do |attribute, translations|
26
+ translation.public_send("#{attribute}=", translations[locale])
27
+ end
28
+ translation.save!
29
+ else
30
+ Mobility.with_locale(locale) do
31
+ translation_params.each do |attribute, translations|
32
+ @object.public_send("#{attribute}=", translations[locale])
33
+ end
34
+ @object.save!
35
+ end
26
36
  end
27
- translation.save!
28
37
  end
29
38
  end
39
+
40
+ def update_translation_value?(locale)
41
+ Spree.always_use_translations? || I18n.default_locale.to_s != locale
42
+ end
30
43
  end
31
44
  end
32
45
  end
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  module Backend
3
- VERSION = '4.8.0'.freeze
3
+ VERSION = '4.8.1'.freeze
4
4
 
5
5
  def self.version
6
6
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.0
4
+ version: 4.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-23 00:00:00.000000000 Z
12
+ date: 2024-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree
@@ -2488,9 +2488,9 @@ licenses:
2488
2488
  - BSD-3-Clause
2489
2489
  metadata:
2490
2490
  bug_tracker_uri: https://github.com/spree/spree_backend/issues
2491
- changelog_uri: https://github.com/spree/spree_backend/releases/tag/v4.8.0
2491
+ changelog_uri: https://github.com/spree/spree_backend/releases/tag/v4.8.1
2492
2492
  documentation_uri: https://docs.spreecommerce.org/
2493
- source_code_uri: https://github.com/spree/spree_backend/tree/v4.8.0
2493
+ source_code_uri: https://github.com/spree/spree_backend/tree/v4.8.1
2494
2494
  post_install_message:
2495
2495
  rdoc_options: []
2496
2496
  require_paths: