onoma 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onoma/item.rb +3 -1
- data/lib/onoma/version.rb +1 -1
- 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: 890d5c0a9fe72ab997f84787c018d0d15babc7f1
|
4
|
+
data.tar.gz: 2e08211af0656a58fce6ee321dcead9d2e301469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34ab0b8193a1875fc0545e24e99c3c9abad3c97506acdf420b559253bc1288d2f656b06508fa8265f6cbcb91cb5a1d75f20acf7f84e9e3713a3af0c0c4b1ca8f
|
7
|
+
data.tar.gz: 38d9f0d8d1001a44d095eb5bdfcf34796cf994b83c9509290b17ebef0c052fe798420042ac5f6ece34201313022bb77c5933200131d20b66176281230dbf66a7
|
data/lib/onoma/item.rb
CHANGED
@@ -11,6 +11,8 @@ module Onoma
|
|
11
11
|
@name = name.to_s
|
12
12
|
@left, @right = @nomenclature.new_boundaries
|
13
13
|
@depth = 0
|
14
|
+
@parent = nil
|
15
|
+
@parent_name = nil
|
14
16
|
parent = options.delete(:parent)
|
15
17
|
if parent.is_a?(Symbol) || parent.is_a?(String)
|
16
18
|
@parent_name = parent.to_s
|
@@ -176,7 +178,7 @@ module Onoma
|
|
176
178
|
|
177
179
|
# Return human name of item
|
178
180
|
def human_name(options = {})
|
179
|
-
"nomenclatures.#{nomenclature.name}.items.#{name}"
|
181
|
+
I18n.translate("nomenclatures.#{nomenclature.name}.items.#{name}", options.merge(default: ["items.#{name}".to_sym, "enumerize.#{nomenclature.name}.#{name}".to_sym, "labels.#{name}".to_sym, name.humanize]))
|
180
182
|
end
|
181
183
|
alias humanize human_name
|
182
184
|
alias localize human_name
|
data/lib/onoma/version.rb
CHANGED