enum_ish 1.3.0 → 1.3.1

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: b366f9ef0d71e73ff92c214008d0459135a03cc5aa6b32d944c1bdc5c5042d8e
4
- data.tar.gz: a428a5f900c77c1caf3c6c9344cbc30e4cee6f10e99868d5b1b18d481bc5ed5c
3
+ metadata.gz: 17516af44e8b97d4f175f6ed2059aab9ca70642a4df8ddf105c6986cbe8da43f
4
+ data.tar.gz: 91de1ab4345f33e60812fa52aca7441e41f7aa8015024db7d28a1cbd3120e79e
5
5
  SHA512:
6
- metadata.gz: d0cfa988dc99c79277ae238f9235743655ec7b51e1ca6e8a3df22951b91e2091193926ca76c5e449663dc2ed64734652303dec847ee377709fba1f9f013a3efc
7
- data.tar.gz: 48b90411d86d74ef8a4c62d0676deb93d0a784376acbb5127fdfd08b9778d46cef8d8c38b85ae754e609ae496f817568d16289f759069934f8e7188a502d9663
6
+ metadata.gz: 85d4dcfbcc2fcdb7da3df9c763d772de245949743a1826850fa24d90457b1e480061cd95ad6c42336a4edba5246e02fd6f29d5821415de936c507cb9aedda4cd
7
+ data.tar.gz: fe398188119a564f482badffb665fbcabe0607975b9936f9c363aa7fbb11c2d765d8758ee70dcce5446f53bfa07f910d08662901f7a6485765fd6129c6a129f3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.3.1
4
+
5
+ * Fix default value for model included ActiveModel.
6
+
3
7
  ## 1.3.0
4
8
 
5
9
  * Support array field.
@@ -49,15 +49,15 @@ module EnumIsh
49
49
  mod = Module.new
50
50
  mod.module_eval do
51
51
  define_method :initialize do |*args|
52
+ super(*args)
52
53
  if respond_to?(enum.name) && public_send(enum.name).nil?
53
54
  default = enum.setting[:default]
54
55
  default = instance_exec(&default) if default.kind_of?(Proc)
55
56
  public_send("#{enum.name}=", default)
56
57
  end
57
- super(*args)
58
58
  end
59
59
  end
60
- @klass.prepend mod
60
+ @klass.send(:include, mod)
61
61
  end
62
62
 
63
63
  def define_accessor(enum)
@@ -1,3 +1,3 @@
1
1
  module EnumIsh
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_ish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-23 00:00:00.000000000 Z
11
+ date: 2020-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  requirements: []
144
- rubygems_version: 3.0.3
144
+ rubygems_version: 3.1.2
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: A ruby and rails extension to generate enum-like methods