acts_as_moonable 0.3.1 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1069cb51f6f5a5cfe576a5589a26091eb9d9d2e92ea2d2dc1f622e93d4cb27ee
4
- data.tar.gz: cfa077d459d3ba48ab1b1ac18073e2946e715fd69d65ab9b1b371adf79fd2c43
3
+ metadata.gz: 6ed8ae3aecc3a6cbb3b6ad8e28e357e99a08995080791f9d01f8e62386b23b9f
4
+ data.tar.gz: c8ff6342d0fa7b33c0a2c65d7cc2b0238599083760c0902767290a01c6b24711
5
5
  SHA512:
6
- metadata.gz: be4769d3247362c0f0c23a50d03f6f5552869c203e519f78ec2fc590e3ca3bad53d3d56f2c790ce590da19124def7f97625c743be35c8a8f9ad46d5d5a1b239e
7
- data.tar.gz: 3edd32893f30569e40f016b369d8cacafcea939360388439ec7de005bf8c251ed0a5a09f505fd014d34b28f955d77939e7ed1a4ac14075bc149205fa8e750531
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("layouts.action.#{action}", model: self.model_name.human)
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.human_attribute_name attr
30
+ self.class.i18n_attribute_name attr
32
31
  end
33
32
 
34
33
  def human_enum_name enum_name
@@ -1,3 +1,3 @@
1
1
  module ActsAsMoonable
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.4'
3
3
  end
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.1
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: 2021-08-11 00:00:00.000000000 Z
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.2.15
67
+ rubygems_version: 3.3.7
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Acts As Moonable Gem.