enum_ish 1.6.0 → 1.6.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: 9578ab7ba6e720321c8706fabc463af41bcd7244e24d65ff736943a197abdc9b
4
- data.tar.gz: 69b73002c3b790e6a737db306fadfb411e418c1ed5e25faf53a96c57f9f44582
3
+ metadata.gz: 8fb31764431d97fa544b90f3d7534f3c96d2fc1acbbfb7d3d44fcaa73da3064e
4
+ data.tar.gz: 84897de0db79b886700f9d061159798aab16dbc120ec52d87d94677a8417de49
5
5
  SHA512:
6
- metadata.gz: 955eb532c9bc238d8721589240bf600412e679f97b6d0c782f2b34916db04dbd757b389f551fa32605516216a5031730ac37c9778df9ff947cd81825c74e7cf7
7
- data.tar.gz: ba5eabfa271493a71ea0d08950b674662535df79a37386b4b59b46000e365ed95f8175946edbd2236310de21b16fb6de3af827766b61db35f3d16820e56cdaf9
6
+ metadata.gz: 9130d50fa059e0a1a0e9237e07b73ad7564a55e500a712ea7c15efdd232cfe69ef67cc09e222b124a819a44b57b2e9da078d9b9bb590c08b8f21e6980392cfac
7
+ data.tar.gz: 204ae64789c49108e1e9faa137aa6737c5f1d7a1c5f79cf55e354e8a80ae4fb11c89235f4dfb5f018ec89a7a7b9c50141f9a2777235a90bced4d946444e9038f
@@ -4,27 +4,41 @@ on: [push, pull_request]
4
4
 
5
5
  jobs:
6
6
  test:
7
- runs-on: ubuntu-18.04
7
+ runs-on: ubuntu-20.04
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0]
12
- gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61']
11
+ ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1]
12
+ gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61', 'rails70']
13
13
  exclude:
14
14
  - ruby: 2.3
15
15
  gemfile: rails60
16
16
  - ruby: 2.3
17
17
  gemfile: rails61
18
+ - ruby: 2.3
19
+ gemfile: rails70
18
20
  - ruby: 2.4
19
21
  gemfile: rails60
20
22
  - ruby: 2.4
21
23
  gemfile: rails61
24
+ - ruby: 2.4
25
+ gemfile: rails70
26
+ - ruby: 2.5
27
+ gemfile: rails70
28
+ - ruby: 2.6
29
+ gemfile: rails70
22
30
  - ruby: 3.0
23
31
  gemfile: rails50
24
32
  - ruby: 3.0
25
33
  gemfile: rails51
26
34
  - ruby: 3.0
27
35
  gemfile: rails52
36
+ - ruby: 3.1
37
+ gemfile: rails50
38
+ - ruby: 3.1
39
+ gemfile: rails51
40
+ - ruby: 3.1
41
+ gemfile: rails52
28
42
 
29
43
  name: ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
30
44
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.6.1
4
+
5
+ * Support activerecord 7.0.
6
+
3
7
  ## 1.6.0
4
8
 
5
9
  * Add `EnumIsh.config.defaults` which allows to set default options for `enum_ish`.
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 6.0.0"
4
+ gem "psych", "~> 3.3.0"
4
5
 
5
6
  gemspec path: "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 7.0.1"
4
+
5
+ gemspec path: "../"
@@ -26,14 +26,18 @@ module EnumIsh
26
26
  enum.mapping.fetch(value, value)
27
27
  end
28
28
 
29
- args =
30
- if ActiveRecord.version > Gem::Version.new('6.1.0.a')
31
- [enum.name]
32
- else
33
- [enum.name, :enum]
29
+ if ActiveRecord.version > Gem::Version.new('7.0.0.a')
30
+ attribute(enum.name) do |subtype|
31
+ EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
32
+ end
33
+ elsif ActiveRecord.version > Gem::Version.new('6.1.0.a')
34
+ decorate_attribute_type(enum.name) do |subtype|
35
+ EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
36
+ end
37
+ else
38
+ decorate_attribute_type(enum.name, :enum) do |subtype|
39
+ EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
34
40
  end
35
- decorate_attribute_type(*args) do |subtype|
36
- EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
37
41
  end
38
42
  end
39
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnumIsh
4
- VERSION = '1.6.0'
4
+ VERSION = '1.6.1'
5
5
  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.6.0
4
+ version: 1.6.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: 2021-08-23 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -115,6 +115,7 @@ files:
115
115
  - gemfiles/rails52.gemfile
116
116
  - gemfiles/rails60.gemfile
117
117
  - gemfiles/rails61.gemfile
118
+ - gemfiles/rails70.gemfile
118
119
  - lib/enum_ish.rb
119
120
  - lib/enum_ish/active_record_definer.rb
120
121
  - lib/enum_ish/active_record_enum_type.rb
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  - !ruby/object:Gem::Version
146
147
  version: '0'
147
148
  requirements: []
148
- rubygems_version: 3.1.6
149
+ rubygems_version: 3.1.2
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: A ruby and rails extension to generate enum-like methods