active_record_enumerated_type 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDU4NjkxNjRjNjVhMTA3MTRiZmNhZjZiNzkyMDFjNTE2NzdjYWY3ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTY4ZmQ3NTJhYjE0NTk5ZmM3ZWJjYjE0NTY0NTAwODI5NGE4ZmMwNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWMzNjQ4ODQzY2VjNGZmZGM4NDMxMTE0YmQzODllYzk3NjE0NzkyOTlkMDVi
|
10
|
+
YjBiMjE3YWE5NGRjYzZiMDkwMzI2MWY1OGE5MTJkNzljMGU1MDNkYTNkNjhk
|
11
|
+
MTJhYmU1NzZmMzhlYzMwYmIxMDJmMGI2ZDk0ZmYzYTJiMTU0NGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTAxMjZjY2Y0YTc0ZTJjNDJlMjczNzk4YjM4N2VjOTAxNzg4MTc4MjZmMTVh
|
14
|
+
YWQzMzU5ODAzYzMyZmZkY2FmMTg0ZDQ3NjY3YzNmYzJhODhmMTcyYmY2OWEw
|
15
|
+
ZGMyNGEwMGI3MjQ1Y2RmZTkwMmQ0NDVhMmE2YTAxNWFlNTNjM2Q=
|
@@ -1,10 +1,12 @@
|
|
1
|
+
require "active_support/core_ext"
|
2
|
+
|
1
3
|
module EnumeratedType
|
2
4
|
def serialize
|
3
5
|
name
|
4
6
|
end
|
5
7
|
|
6
8
|
def human
|
7
|
-
I18n.translate!(name, scope: [:enumerated_type,
|
9
|
+
I18n.translate!(name, scope: [:enumerated_type, self.class.name.underscore])
|
8
10
|
rescue I18n::MissingTranslationData
|
9
11
|
to_s.titleize
|
10
12
|
end
|
@@ -4,7 +4,7 @@ describe EnumeratedType do
|
|
4
4
|
describe "I18n" do
|
5
5
|
it "returns an internationalized name" do
|
6
6
|
allow(I18n).to receive(:translate!)
|
7
|
-
.with(:finished, scope: [:enumerated_type,
|
7
|
+
.with(:finished, scope: [:enumerated_type, "status"])
|
8
8
|
.and_return("finito")
|
9
9
|
|
10
10
|
expect(Status[:finished].human).to eq "finito"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_enumerated_type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eddy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|