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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab79d320f3c47fe42bb2842a6a406c11cf8d56b3
4
- data.tar.gz: 8ba316c7d76c35892b6014351521ee46a90d6688
3
+ metadata.gz: d1a30c04206f994bc1c7b012e13acaf61dc80636
4
+ data.tar.gz: ec22b2e3cd37215bd62013506a308669489c5a84
5
5
  SHA512:
6
- metadata.gz: be513ece8570227e0f743e53d7f179438bffbe98febc11966f4dc169c8a8d8d56cd5ae7d25302eb8ad373803ef847b9247e53797da4d42f7bcfeceb3352470fa
7
- data.tar.gz: 5168aa575c0d7b247c2d2e14b372ad33f1ca891a841c11276da74e12694a944d46d5e1e4eef3a405a3223b307cefa36c13549d6ebcdb518e720a97bf78fabf59
6
+ metadata.gz: 3dd61b11bb67d7a51d559c8e737044e948b8650f689b16421f50ffc5f66301e328d654dbc33caf7a3d5206c524b45b9a520646835b39d0f9a5d1890dc1a867ad
7
+ data.tar.gz: 21e78980aa80138e0d97c79e420855f9d07de81ebf27ac473de21f6b9ecd7f991fe6f5e0d7bb643f3ee575b1258595db65e728707084765816b0ce603360c771
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Globalize
4
4
  module Automatic
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  end
7
7
  end
@@ -173,13 +173,15 @@ module Globalize::Automatic
173
173
 
174
174
  private
175
175
  def after_save
176
- changed_attr_names =
177
- globalized_model.translated_attribute_names & changes.keys.map(&:to_sym)
178
-
179
- execute_after_commit do
180
- globalized_model.run_automatic_translation(from_locale: locale,
181
- attribute_names: changed_attr_names)
182
- true
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globalize-automatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuichi Takeuchi