azahara_schema 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/azahara_schema/attribute_name.rb +14 -6
- data/lib/azahara_schema/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de52d45e49249449b6a9b9ef878c3ddb2f77d3371d3d3d203db5501ccab9cca6
|
4
|
+
data.tar.gz: eb05968e0506eadf9cf96396f965e45b9752edba05f78df24b2e803253e9775e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aac5dc3fbec9b3b830b9e9c71e798e0591ee5ed1cbda25951f09c416057785dd2f33a5d75db944cb484dc8280f36982c13603d9cd4315cb5582e8719d934706
|
7
|
+
data.tar.gz: 98f3dce85c3205df24378c42178d550dd76006109338e251c863ae23606d2e1ac363efd9db1fb72299b91b645c18b90b6ef8af4734a1da7ed781e68106dfc9c7
|
@@ -32,8 +32,12 @@ module AzaharaSchema
|
|
32
32
|
(i18n_scope + '.' + i18n_key.to_s).to_sym
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
i18n_scope + '.' + i18n_key.to_s.pluralize
|
35
|
+
def i18n_scoped_list_prefix
|
36
|
+
i18n_scope + '.' + i18n_key.to_s.pluralize
|
37
|
+
end
|
38
|
+
|
39
|
+
def i18n_scoped_list_key(value, prefix=self.i18n_scoped_list_prefix)
|
40
|
+
prefix + '.' + value.to_s
|
37
41
|
end
|
38
42
|
|
39
43
|
def i18n_fallback_keys
|
@@ -47,15 +51,19 @@ module AzaharaSchema
|
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
50
|
-
def
|
54
|
+
def i18n_list_fallback_prefixes
|
51
55
|
if attribute.respond_to?(:attribute)
|
52
56
|
parent_attr_name = attribute.attribute.attribute_name
|
53
|
-
|
54
|
-
|
55
|
-
|
57
|
+
prefixes = [ parent_attr_name.i18n_scoped_list_prefix ]
|
58
|
+
prefixes.concat( parent_attr_name.i18n_list_fallback_prefixes )
|
59
|
+
prefixes
|
56
60
|
else
|
57
61
|
[]
|
58
62
|
end
|
59
63
|
end
|
64
|
+
|
65
|
+
def i18n_list_fallback_keys(value)
|
66
|
+
prefixes.collect{|pref| i18n_scoped_list_key(value, pref) }
|
67
|
+
end
|
60
68
|
end
|
61
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azahara_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Ezr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|