globalize-automatic 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/globalize/automatic/version.rb +1 -1
- data/lib/globalize/automatic.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1a30c04206f994bc1c7b012e13acaf61dc80636
|
4
|
+
data.tar.gz: ec22b2e3cd37215bd62013506a308669489c5a84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dd61b11bb67d7a51d559c8e737044e948b8650f689b16421f50ffc5f66301e328d654dbc33caf7a3d5206c524b45b9a520646835b39d0f9a5d1890dc1a867ad
|
7
|
+
data.tar.gz: 21e78980aa80138e0d97c79e420855f9d07de81ebf27ac473de21f6b9ecd7f991fe6f5e0d7bb643f3ee575b1258595db65e728707084765816b0ce603360c771
|
data/lib/globalize/automatic.rb
CHANGED
@@ -173,13 +173,15 @@ module Globalize::Automatic
|
|
173
173
|
|
174
174
|
private
|
175
175
|
def after_save
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
176
|
+
if globalized_model
|
177
|
+
changed_attr_names =
|
178
|
+
globalized_model.translated_attribute_names & changes.keys.map(&:to_sym)
|
179
|
+
|
180
|
+
execute_after_commit do
|
181
|
+
globalized_model.run_automatic_translation(from_locale: locale,
|
182
|
+
attribute_names: changed_attr_names)
|
183
|
+
true
|
184
|
+
end
|
183
185
|
end
|
184
186
|
true
|
185
187
|
end
|