enumerations 2.2.2 → 2.2.3
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 +4 -4
- data/lib/enumerations/value.rb +2 -2
- data/lib/enumerations/version.rb +1 -1
- data/test/helpers/test_helper.rb +4 -4
- data/test/value_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bff6ddbd1cfb803b3463c11796daf3c81f1c741
|
4
|
+
data.tar.gz: 20a258a2ed4129ed92b044f2933fb366d45aba6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 584c186148b1038d4aadbdd1ee4cb230ee32b40332aca1888933a2ac2813ad61dd356eb548701ab52a10a9e426122ba70e6022cc6254001431b3fd2e51c3d198
|
7
|
+
data.tar.gz: 7048a1acf02560a3311d3956d09ce76d25651a631bf7b4a169d7513d28f4f656142ec93a0f44fff6667022d8651f07cdc81104b2eab969c5dabb0468c65bc72e
|
data/lib/enumerations/value.rb
CHANGED
@@ -65,8 +65,8 @@ module Enumerations
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def translate_attribute(key, locale)
|
68
|
-
I18n.t(key, scope: [:enumerations, self.class.name.underscore, symbol],
|
69
|
-
default: @attributes[key],
|
68
|
+
I18n.t(key, scope: [:enumerations, self.class.name.demodulize.underscore, symbol],
|
69
|
+
default: @attributes[key].to_s,
|
70
70
|
locale: locale)
|
71
71
|
end
|
72
72
|
|
data/lib/enumerations/version.rb
CHANGED
data/test/helpers/test_helper.rb
CHANGED
@@ -19,10 +19,10 @@ class Status < Enumerations::Base
|
|
19
19
|
end
|
20
20
|
|
21
21
|
class Role < Enumerations::Base
|
22
|
-
value :admin,
|
23
|
-
value :editor,
|
24
|
-
value :author,
|
25
|
-
value :lecturer
|
22
|
+
value :admin, name: 'Admin', admin: true, active: true
|
23
|
+
value :editor, name: 'Editor', admin: true, active: false, description: 'Edits newspapers'
|
24
|
+
value :author, name: 'Author'
|
25
|
+
value :lecturer, type: :croatist
|
26
26
|
|
27
27
|
def my_custom_name
|
28
28
|
['user', name].join('_')
|
data/test/value_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomislav Car
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.6.8
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Enumerations for ActiveRecord!
|