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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec9f4c3bb1f610189a9b2c96f922772f890de3ffd54fe8ea37efeb64e9d98df8
4
- data.tar.gz: 94f6c5a99f4c0ffcd6f586ba5147af237abd5542c0e56c3d614da6fe8e8f82b3
3
+ metadata.gz: 5da6726c70affc2d74f8d74a2766f01f8e81d8f387e962bf3bd60e1a9a079b86
4
+ data.tar.gz: 2b440b7def817728a043c0424e472cd3eae9345e79564d4fdd95560e0345e2dc
5
5
  SHA512:
6
- metadata.gz: 4166722aaf2a1f8150c22ff046efd1e709ea93fa00c58942c84987e91fc392e2e68d1f858bd08b4f4a8ad27230eb97248cb3eb830777920a2a7456cb38b4305f
7
- data.tar.gz: 74dbfed20480a47d55266030827c6077b33116703730b8a9acb3e341d931d153b4dd065c4556c11df005f98597fab6c1b7295a946b5d09efc5b259d1b2b50292
6
+ metadata.gz: 83fe90762f4228d41578d3c4693d6a7ddac0d5e2ddfffeb2d09f6c35dcaa17b58db989294557c5b20ddf45c4917850ab61808cc1e72574c32696776c5cf14468
7
+ data.tar.gz: 456cbd451b16da6da0c166d4dbf6b5d4bddce3df7bf232993a954f6a0334d6a0ec998a602c995f5f75fb9f4d8f1667b6f6da3fbd5d382518f39a483cc793c155
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wayaku
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
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.3
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-10 00:00:00.000000000 Z
11
+ date: 2024-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord