enumerations 2.3.2 → 2.3.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/base.rb +3 -1
- data/lib/enumerations/finder_methods.rb +3 -1
- data/lib/enumerations/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3236e6559134898d597bcdd10d713f1e8b0221ebc86c40c51b99ee99b9a902f
|
4
|
+
data.tar.gz: a16037b68fca739949c3952260e44cde3ad904de8072ea4f9fe9216870bba39b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375ca1a05df8bf65c6ecf4086fd9bb0a4db797398079a9b414aea37851f7ed1bcf56f88b2acfeb2e509a9b4f674b9ce45b2c807377acb8ed5253d981625f5134
|
7
|
+
data.tar.gz: 4e02e59780bc7321acf18233b784dfc0b3f1d45e9b8d97e7b43c2a3c99e8c9b688adb6a5a15d884b4d2d0def1b9918bd824c7936f84a55eb38de55d5779f46d4
|
data/lib/enumerations/base.rb
CHANGED
@@ -4,7 +4,7 @@ require 'enumerations/value'
|
|
4
4
|
require 'enumerations/finder_methods'
|
5
5
|
|
6
6
|
module Enumerations
|
7
|
-
class Base
|
7
|
+
class Base < ActiveSupport::Multibyte::Chars
|
8
8
|
extend Enumerations::FinderMethods
|
9
9
|
include Enumerations::Value
|
10
10
|
|
@@ -126,6 +126,8 @@ module Enumerations
|
|
126
126
|
attr_reader :symbol, :attributes
|
127
127
|
|
128
128
|
def initialize(symbol, attributes)
|
129
|
+
super(symbol)
|
130
|
+
|
129
131
|
@symbol = symbol
|
130
132
|
@attributes = attributes
|
131
133
|
|
@@ -39,7 +39,9 @@ module Enumerations
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def find_by_primary_key(primary_key)
|
42
|
-
value_from_symbol_index(primary_key)
|
42
|
+
return value_from_symbol_index(primary_key.to_i) if primary_key.is_a?(String)
|
43
|
+
|
44
|
+
value_from_symbol_index(primary_key)
|
43
45
|
end
|
44
46
|
|
45
47
|
private
|
data/lib/enumerations/version.rb
CHANGED