glib-web 3.11.0 → 3.11.1

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: 29bf404f48d26b824a2e10162a8ec01be7a13754027b4bd3e6b625c1255dbb80
4
- data.tar.gz: 5ed5e65ac4e3cbd23180de8fd03f2a98746b4a5df787d8d69f5f25c9d0f66bbb
3
+ metadata.gz: 67a72ba29ae5a4a9d5d61d529db6ad2316af2fb2d76042ca7fda76b309b5dcba
4
+ data.tar.gz: c3e935f1d809ee9ce3ec3fa78bdf53250303192949909b12ebf8ac5f9f27f7b3
5
5
  SHA512:
6
- metadata.gz: 3c42ecfe127600686502e3721e37a05bf62ce0b194801f42c0c1d49c5df09d12f86cdd8435e682686de4d2c2cf7d288ca6c205cf3da48a452d1e2aadb1f685e1
7
- data.tar.gz: '082866223cfe93db662d532a2030bc60428d82ae1d62c2b98c9910d2e37c3054ca5120d851cb021210eaca9cf60828483a3f91acc70061110d3581dcf17d015a'
6
+ metadata.gz: 588dc4f17590880d8c0e6eaacf7f467a1db815a24e317d0d458449c7065d9dbd8ac77ddf7b621581a48992528306334d45439f8b9a1b7acaf4c4e42d53b72ba9
7
+ data.tar.gz: c1d4655e081970ad4739397ce2b0f221cb7a491757c9da532c433dd85245ba0a4b39e87164c00a2e83942e008c439298b76d528b7bd65cb93abf5b8b54ec089d
@@ -5,6 +5,11 @@ module Glib
5
5
  keys ||= clazz.defined_enums[enum_name].keys
6
6
  keys.map do |i|
7
7
  text = clazz.glib_enum_humanize(enum_field, i)
8
+
9
+ if text.nil?
10
+ raise "activerecord.attributes.#{clazz.model_name.i18n_key}.#{enum_field.to_s.pluralize}.#{i}"
11
+ end
12
+
8
13
  if include_hints
9
14
  i18n_key = clazz.model_name.i18n_key
10
15
  hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.pluralize}.#{i}.hint")
@@ -19,11 +19,12 @@ module Glib
19
19
  module ClassMethods
20
20
  def glib_enum_humanize(enum_name, enum_value, default_translation = nil)
21
21
  if enum_value
22
+ translation_key = "activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}"
23
+
22
24
  if default_translation.nil? && Rails.env.development?
23
- i18n_key = "activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}"
24
- I18n.t(i18n_key, raise: I18n::MissingTranslationData)
25
+ I18n.t(translation_key, raise: I18n::MissingTranslationData)
25
26
  else
26
- I18n.t(i18n_key, default: default_translation)
27
+ I18n.t(translation_key, default: default_translation)
27
28
  end
28
29
  end
29
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''