wayaku 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wayaku/version.rb +1 -1
- data/lib/wayaku.rb +7 -5
- 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: 5da6726c70affc2d74f8d74a2766f01f8e81d8f387e962bf3bd60e1a9a079b86
|
4
|
+
data.tar.gz: 2b440b7def817728a043c0424e472cd3eae9345e79564d4fdd95560e0345e2dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83fe90762f4228d41578d3c4693d6a7ddac0d5e2ddfffeb2d09f6c35dcaa17b58db989294557c5b20ddf45c4917850ab61808cc1e72574c32696776c5cf14468
|
7
|
+
data.tar.gz: 456cbd451b16da6da0c166d4dbf6b5d4bddce3df7bf232993a954f6a0334d6a0ec998a602c995f5f75fb9f4d8f1667b6f6da3fbd5d382518f39a483cc793c155
|
data/lib/wayaku/version.rb
CHANGED
data/lib/wayaku.rb
CHANGED
@@ -36,11 +36,12 @@ module Wayaku
|
|
36
36
|
def parse_attribute(args)
|
37
37
|
[*args].inject([]) do |array, arg|
|
38
38
|
additions = []
|
39
|
-
scope = "activerecord.attributes.#{model_name.singular}"
|
40
|
-
word = I18n.backend.send(:lookup, I18n.locale, arg, scope)
|
41
|
-
|
42
|
-
additions += [word, arg.to_s] unless word.nil?
|
43
39
|
|
40
|
+
# attribute
|
41
|
+
word = I18n.translate(arg, scope: "activerecord.attributes.#{model_name.singular}")
|
42
|
+
additions += [word, arg.to_s]
|
43
|
+
|
44
|
+
# enumerized_attribute
|
44
45
|
if respond_to?(:enumerize) && enumerized_attributes[arg]
|
45
46
|
additions << enumerized_attributes[arg].values.inject([]) { |rst, val| rst + [val.text, val] }
|
46
47
|
end
|
@@ -50,7 +51,8 @@ module Wayaku
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def format(array)
|
53
|
-
_add_indent(array).flatten
|
54
|
+
array = _add_indent(array).flatten
|
55
|
+
array
|
54
56
|
end
|
55
57
|
|
56
58
|
def _add_indent(array, indent: 0)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wayaku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- soma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|