translateable_attributes 0.3.1 → 0.3.2

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: 2914565205b37db29a0b165f82c17f9f9fab874f759427bac4c4baa0d2ae4541
4
- data.tar.gz: e7db39c5936bc5526bda12ed8746a32633f3fddff48252acc00ee7bdfdeac8ec
3
+ metadata.gz: '08b5e2a012385947321e5c7be4cb4f87337d9fcd3e0533e23bc2d9fef4e28d4d'
4
+ data.tar.gz: 9fc725b5dc4b6182575f3542c07a29a04dae1ff0602cbc1907b8991820e9dae1
5
5
  SHA512:
6
- metadata.gz: 627685d96c6547fbe784549d033bbe0118b05b4afb0508fabb7ebc62d9203cb92a8889213022527ccb25442e12ea91b5fe23c4b3f6ba2d2b9b8e24d2ff5d3fe7
7
- data.tar.gz: b9c06ca689ee048fb64871f7a1777be7e83a24003f428856bd2da1edef1ae57b1098a59643d9e6c4573a1dee2f594330bee374c17a1c53774249849593747b0e
6
+ metadata.gz: a0c0d8d2cf87dcbbdd1da233311c975a966da5618aac09877d9a1317bf0ca3ce43a25a79ac04f6e06179483227da1c3f185055ea2637f4e7e626418e3417c49f
7
+ data.tar.gz: 30844cf23593caade015461f43f3b84296477a8b406a85924435185ca9a44d56962f31f6ea098e7cc27a21548e2c67cdb2cee876586c82714306f2dd5fa7c063
data/HISTORY.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 0.3.2
2
+ Default attributes_for_select to an empty array if no translation found - https://github.com/tmikoss/translateable_attributes/pull/4
3
+
1
4
  ### 0.3.1
2
5
  Update for compatibility with I18n 1.8.9
3
6
 
@@ -11,7 +11,9 @@ module TranslateableAttributes
11
11
  end
12
12
 
13
13
  define_singleton_method "#{plural_attribute}_for_select" do
14
- I18n.t(namespace).each_with_object([]) do |(value, translation), collection|
14
+ options = I18n.t(namespace, default: nil) || []
15
+
16
+ options.each_with_object([]) do |(value, translation), collection|
15
17
  collection << [translation, value]
16
18
  end
17
19
  end
@@ -1,3 +1,3 @@
1
1
  module TranslateableAttributes
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translateable_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toms Mikoss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-31 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.0.6
139
+ rubygems_version: 3.3.17
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Helper methods to display translated values of object attributes.