enumerations 2.3.2 → 2.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b985b16b06e7879a3d5f06aad2ce71ee4ff17ba4f909e4b03b055ffbe63ef38f
4
- data.tar.gz: 7281e76ed89746b3484203eb5c93e6f29d4e8cb08686fa895eaf60b3fa8a1186
3
+ metadata.gz: b3236e6559134898d597bcdd10d713f1e8b0221ebc86c40c51b99ee99b9a902f
4
+ data.tar.gz: a16037b68fca739949c3952260e44cde3ad904de8072ea4f9fe9216870bba39b
5
5
  SHA512:
6
- metadata.gz: '09d4e8582c67a308d0fd327206fb084daa311d380fb0e270c5220cfbc054900308d9c68aab45189b63e8cea19a2885560a2a9f8be33177a7017d871491dee5aa'
7
- data.tar.gz: cd317e0ebc64da8c2c11b85883dadfb0c91586164bb177382cbe6e8ee80dabfd71e2018ba0da84072ac6ee66c85b2e06345e24195c8143a054256591ec47a2cc
6
+ metadata.gz: 375ca1a05df8bf65c6ecf4086fd9bb0a4db797398079a9b414aea37851f7ed1bcf56f88b2acfeb2e509a9b4f674b9ce45b2c807377acb8ed5253d981625f5134
7
+ data.tar.gz: 4e02e59780bc7321acf18233b784dfc0b3f1d45e9b8d97e7b43c2a3c99e8c9b688adb6a5a15d884b4d2d0def1b9918bd824c7936f84a55eb38de55d5779f46d4
@@ -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) || value_from_symbol_index(primary_key.to_s.to_i)
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
@@ -1,3 +1,3 @@
1
1
  module Enumerations
2
- VERSION = '2.3.2'.freeze
2
+ VERSION = '2.3.3'.freeze
3
3
  end
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.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomislav Car