acts_as_moonable 0.3.1 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acts_as_moonable/humanable.rb +4 -5
- data/lib/acts_as_moonable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ed8ae3aecc3a6cbb3b6ad8e28e357e99a08995080791f9d01f8e62386b23b9f
|
4
|
+
data.tar.gz: c8ff6342d0fa7b33c0a2c65d7cc2b0238599083760c0902767290a01c6b24711
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 690e8927c16bd7c5d7779b310197aef0b84a6bd8ffd4cd1e0a8c1cc10abcc63a5ce32267be9b4db7e92956d0da4a7dad1ece1677f1fb3e50de0ef968e3a4a647
|
7
|
+
data.tar.gz: 19028fba8e318682fc6c8e74ef4c2c3ebd68e2fb2d89234a54eed0dc3bcd99b855ddc183eb166b4c1e5fb6f203697ed1db69445ff6b73172b0df573a1a3a8095
|
@@ -7,12 +7,11 @@ module ActsAsMoonable
|
|
7
7
|
self.human_attribute_name attr
|
8
8
|
end
|
9
9
|
|
10
|
-
def human_action_name action
|
11
|
-
I18n.t("
|
10
|
+
def human_action_name action, views="defaults"
|
11
|
+
I18n.t("#{views}.action.#{action}", model: self.model_name.human)
|
12
12
|
end
|
13
13
|
|
14
14
|
def human_enum_name(enum_name, enum_value)
|
15
|
-
# I18n.t("activerecord.attributes.#{self.model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}")
|
16
15
|
self.human_attribute_name "#{enum_name}.#{enum_value}"
|
17
16
|
end
|
18
17
|
|
@@ -22,13 +21,13 @@ module ActsAsMoonable
|
|
22
21
|
end
|
23
22
|
|
24
23
|
def human_array_choices enum_name
|
25
|
-
array_values = self.const_get enum_name.upcase
|
24
|
+
array_values = self.const_get enum_name.to_s.pluralize.upcase
|
26
25
|
array_values.map { |enum_value| [ self.human_enum_name(enum_name, enum_value), enum_value ] }
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
29
|
def i18n_attribute_name attr
|
31
|
-
self.class.
|
30
|
+
self.class.i18n_attribute_name attr
|
32
31
|
end
|
33
32
|
|
34
33
|
def human_enum_name enum_name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_moonable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Li Qi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
67
|
+
rubygems_version: 3.3.7
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Acts As Moonable Gem.
|