activerecord-mysql-enum 1.0.0.pre.2 → 2.0.1.pre.ga.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 654ebffea2d493ba5392b1aab3f69048c2c38462cf1782d109ee417e46605a89
4
- data.tar.gz: 28009a9d255721863644711c217633a26b7de8275764508f80bca2ac1a086d7f
3
+ metadata.gz: 8d75edfad144396533c66156f7233d882ca4b26f9cc5c06f436f225442255b7e
4
+ data.tar.gz: d5e687c17ccc89f6bbcdedfbb43f78508a34d0123df68b8bd6017b04c8ea2f4b
5
5
  SHA512:
6
- metadata.gz: d68c31a06bb274bfc8599f4c120976e3b5534df6bdb299fee0ba9495e08ef8a4fece362d2da6e0fb0b793a3d0275a393a27dbcf87302804ffbe4e3197e14bd88
7
- data.tar.gz: d6e78050ab6bdce2a23e8f3479a82eef0dd669cbb357bafd843a550de1781b96d35fc14888f2f4f28ff2a7104a0175b75a88a46130776c0477c29e2cd6dc986f
6
+ metadata.gz: b4caa2673e08242823a6df1769b0a7bf955aa1e8812aff450fb47950e57e99a462811af592862c4350dfbe2dae77ed206aa502b83f9bb116cbae47cb6120664e
7
+ data.tar.gz: b87dea3dbf6c11f019e07e6a06591b8525ce557d738af8de715d14a12117c41dbdcdadc41808d4930fd7be3f2d98e5c0f9bff1a6a4dcab9c342801b30bd9fa59
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: ActiveRecord MySQL Enum
3
+ on: [push]
4
+ jobs:
5
+ test-ruby-2:
6
+ name: Ruby 2 Unit Tests
7
+ runs-on: ubuntu-latest
8
+ services:
9
+ mysql:
10
+ image: mysql:5.7
11
+ env:
12
+ MYSQL_DATABASE: activerecord_mysql_enum_test
13
+ MYSQL_USER: user
14
+ MYSQL_PASSWORD: password
15
+ MYSQL_ROOT_PASSWORD: rootpassword
16
+ ports:
17
+ - 3306:3306
18
+ options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ ruby: [2.5.8, 2.6.5, 2.7]
23
+ gemfile:
24
+ - gemfiles/rails_5.gemfile
25
+ - gemfiles/rails_6.gemfile
26
+ env:
27
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
28
+ DATABASE_MYSQL_HOST: 127.0.0.1
29
+ DATABASE_MYSQL_USERNAME: user
30
+ DATABASE_MYSQL_PASSWORD: password
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ bundler: 2.2.29
37
+ bundler-cache: true
38
+ - run: RAILS_ENV=test bundle exec rake db:create
39
+ - run: bundle exec rspec
40
+
41
+ test-ruby-3:
42
+ name: Ruby 3 Unit Tests
43
+ runs-on: ubuntu-latest
44
+ services:
45
+ mysql:
46
+ image: mysql:5.7
47
+ env:
48
+ MYSQL_DATABASE: activerecord_mysql_enum_test
49
+ MYSQL_USER: user
50
+ MYSQL_PASSWORD: password
51
+ MYSQL_ROOT_PASSWORD: rootpassword
52
+ ports:
53
+ - 3306:3306
54
+ options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
55
+ strategy:
56
+ fail-fast: false
57
+ matrix:
58
+ ruby: ['3.0', 3.1]
59
+ gemfile:
60
+ - gemfiles/rails_6.gemfile
61
+ env:
62
+ BUNDLE_GEMFILE: gemfiles/rails_6.gemfile
63
+ DATABASE_MYSQL_HOST: 127.0.0.1
64
+ DATABASE_MYSQL_USERNAME: user
65
+ DATABASE_MYSQL_PASSWORD: password
66
+ steps:
67
+ - uses: actions/checkout@v2
68
+ - uses: ruby/setup-ruby@v1
69
+ with:
70
+ ruby-version: ${{ matrix.ruby }}
71
+ bundler: 2.2.29
72
+ bundler-cache: true
73
+ - run: RAILS_ENV=test bundle exec rake db:create
74
+ - run: bundle exec rspec
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.5
data/Appraisals CHANGED
@@ -1,13 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'rails-4' do
4
- gem 'rails', '~> 4.2'
5
- end
6
-
7
3
  appraise 'rails-5' do
8
4
  gem 'rails', '~> 5.2'
5
+ gem 'mysql2', '~> 0.4'
9
6
  end
10
7
 
11
8
  appraise 'rails-6' do
12
- gem 'rails', '~> 6.0'
9
+ gem 'rails', '~> 6.0.0'
10
+ gem 'mysql2', '~> 0.5'
13
11
  end
data/CHANGELOG.md CHANGED
@@ -4,7 +4,15 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [1.0.0] - Unreleased
7
+ ## [2.0.1] - Unreleased
8
+ - Upgraded to Ruby 2.7 and Bundler 2.
9
+ - Added support for Ruby 3.0 and 3.1.
10
+
11
+ ## [2.0.0] - 2021-08-10
12
+ ### Removed
13
+ - Dropped support for Rails less than 5
14
+
15
+ ## [1.0.0] - 2020-09-16
8
16
  ### Added
9
17
  - A Rspec test suit
10
18
  - Dummy Rails app to be used by tests
@@ -21,7 +29,7 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
21
29
  - Support for the mysql gem
22
30
  - Support for Rails < 4.2
23
31
 
24
- ## [0.1.4] - Unreleased
32
+ ## [0.1.4] - 2020-08-20
25
33
  ### Fixed
26
34
  - Fixed bug in `mysql_adapter` where optional arguments being passed to `type_to_sql` would cause
27
35
  an unexpected error
@@ -45,6 +53,7 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
45
53
  ### Changed
46
54
  - Renamed the gem from `enum_column3` to `activerecord-mysql-enum`
47
55
 
56
+ [2.0.0]: https://github.com/Invoca/activerecord-mysql-enum/compare/v1.0.0...v2.0.0
48
57
  [1.0.0]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.4...v1.0.0
49
58
  [0.1.4]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.3...v0.1.4
50
59
  [0.1.3]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.2...v0.1.3
data/Gemfile CHANGED
@@ -10,6 +10,6 @@ gem 'coveralls', require: false
10
10
  gem 'pry'
11
11
  gem 'pry-byebug'
12
12
  gem 'rake', '~> 13.0'
13
- gem 'rails', '~> 4.2'
14
- gem 'rspec'
15
- gem 'rspec-rails', '~> 3.0'
13
+ gem 'rails', '~> 5.2'
14
+ gem 'rspec', '~> 3.11'
15
+ gem 'rspec-rails', '~> 5.0'
data/Gemfile.lock CHANGED
@@ -1,56 +1,63 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-mysql-enum (1.0.0.pre.2)
5
- activerecord (>= 4.2, < 7)
6
- mysql2 (= 0.4.5)
4
+ activerecord-mysql-enum (2.0.1.pre.ga.0)
5
+ activerecord (>= 5.2, < 7)
6
+ mysql2 (>= 0.4.5, < 0.6)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionmailer (4.2.11.3)
12
- actionpack (= 4.2.11.3)
13
- actionview (= 4.2.11.3)
14
- activejob (= 4.2.11.3)
11
+ actioncable (5.2.6)
12
+ actionpack (= 5.2.6)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailer (5.2.6)
16
+ actionpack (= 5.2.6)
17
+ actionview (= 5.2.6)
18
+ activejob (= 5.2.6)
15
19
  mail (~> 2.5, >= 2.5.4)
16
- rails-dom-testing (~> 1.0, >= 1.0.5)
17
- actionpack (4.2.11.3)
18
- actionview (= 4.2.11.3)
19
- activesupport (= 4.2.11.3)
20
- rack (~> 1.6)
21
- rack-test (~> 0.6.2)
22
- rails-dom-testing (~> 1.0, >= 1.0.5)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.2.6)
22
+ actionview (= 5.2.6)
23
+ activesupport (= 5.2.6)
24
+ rack (~> 2.0, >= 2.0.8)
25
+ rack-test (>= 0.6.3)
26
+ rails-dom-testing (~> 2.0)
23
27
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
- actionview (4.2.11.3)
25
- activesupport (= 4.2.11.3)
28
+ actionview (5.2.6)
29
+ activesupport (= 5.2.6)
26
30
  builder (~> 3.1)
27
- erubis (~> 2.7.0)
28
- rails-dom-testing (~> 1.0, >= 1.0.5)
31
+ erubi (~> 1.4)
32
+ rails-dom-testing (~> 2.0)
29
33
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
30
- activejob (4.2.11.3)
31
- activesupport (= 4.2.11.3)
32
- globalid (>= 0.3.0)
33
- activemodel (4.2.11.3)
34
- activesupport (= 4.2.11.3)
35
- builder (~> 3.1)
36
- activerecord (4.2.11.3)
37
- activemodel (= 4.2.11.3)
38
- activesupport (= 4.2.11.3)
39
- arel (~> 6.0)
40
- activesupport (4.2.11.3)
41
- i18n (~> 0.7)
34
+ activejob (5.2.6)
35
+ activesupport (= 5.2.6)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.2.6)
38
+ activesupport (= 5.2.6)
39
+ activerecord (5.2.6)
40
+ activemodel (= 5.2.6)
41
+ activesupport (= 5.2.6)
42
+ arel (>= 9.0)
43
+ activestorage (5.2.6)
44
+ actionpack (= 5.2.6)
45
+ activerecord (= 5.2.6)
46
+ marcel (~> 1.0.0)
47
+ activesupport (5.2.6)
48
+ concurrent-ruby (~> 1.0, >= 1.0.2)
49
+ i18n (>= 0.7, < 2)
42
50
  minitest (~> 5.1)
43
- thread_safe (~> 0.3, >= 0.3.4)
44
51
  tzinfo (~> 1.1)
45
- appraisal (2.3.0)
52
+ appraisal (2.4.1)
46
53
  bundler
47
54
  rake
48
55
  thor (>= 0.14.0)
49
- arel (6.0.4)
56
+ arel (9.0.0)
50
57
  builder (3.2.4)
51
58
  byebug (11.1.3)
52
59
  coderay (1.1.3)
53
- concurrent-ruby (1.1.7)
60
+ concurrent-ruby (1.1.9)
54
61
  coveralls (0.8.23)
55
62
  json (>= 1.8, < 3)
56
63
  simplecov (~> 0.16.1)
@@ -58,102 +65,109 @@ GEM
58
65
  thor (>= 0.19.4, < 2.0)
59
66
  tins (~> 1.6)
60
67
  crass (1.0.6)
61
- diff-lcs (1.4.4)
62
- docile (1.3.2)
63
- erubis (2.7.0)
64
- globalid (0.4.2)
65
- activesupport (>= 4.2.0)
66
- i18n (0.9.5)
68
+ diff-lcs (1.5.0)
69
+ docile (1.4.0)
70
+ erubi (1.10.0)
71
+ globalid (0.5.2)
72
+ activesupport (>= 5.0)
73
+ i18n (1.8.10)
67
74
  concurrent-ruby (~> 1.0)
68
- json (2.3.1)
69
- loofah (2.6.0)
75
+ json (2.5.1)
76
+ loofah (2.11.0)
70
77
  crass (~> 1.0.2)
71
78
  nokogiri (>= 1.5.9)
72
79
  mail (2.7.1)
73
80
  mini_mime (>= 0.1.1)
81
+ marcel (1.0.1)
74
82
  method_source (1.0.0)
75
- mini_mime (1.0.2)
76
- mini_portile2 (2.4.0)
77
- minitest (5.14.1)
78
- mysql2 (0.4.5)
79
- nokogiri (1.10.10)
80
- mini_portile2 (~> 2.4.0)
81
- pry (0.13.1)
83
+ mini_mime (1.1.0)
84
+ mini_portile2 (2.6.1)
85
+ minitest (5.14.4)
86
+ mysql2 (0.5.3)
87
+ nio4r (2.5.8)
88
+ nokogiri (1.12.2)
89
+ mini_portile2 (~> 2.6.1)
90
+ racc (~> 1.4)
91
+ pry (0.14.1)
82
92
  coderay (~> 1.1)
83
93
  method_source (~> 1.0)
84
- pry-byebug (3.9.0)
94
+ pry-byebug (3.8.0)
85
95
  byebug (~> 11.0)
86
- pry (~> 0.13.0)
87
- rack (1.6.13)
88
- rack-test (0.6.3)
89
- rack (>= 1.0)
90
- rails (4.2.11.3)
91
- actionmailer (= 4.2.11.3)
92
- actionpack (= 4.2.11.3)
93
- actionview (= 4.2.11.3)
94
- activejob (= 4.2.11.3)
95
- activemodel (= 4.2.11.3)
96
- activerecord (= 4.2.11.3)
97
- activesupport (= 4.2.11.3)
98
- bundler (>= 1.3.0, < 2.0)
99
- railties (= 4.2.11.3)
100
- sprockets-rails
101
- rails-deprecated_sanitizer (1.0.3)
102
- activesupport (>= 4.2.0.alpha)
103
- rails-dom-testing (1.0.9)
104
- activesupport (>= 4.2.0, < 5.0)
105
- nokogiri (~> 1.6)
106
- rails-deprecated_sanitizer (>= 1.0.1)
96
+ pry (~> 0.10)
97
+ racc (1.5.2)
98
+ rack (2.2.3)
99
+ rack-test (1.1.0)
100
+ rack (>= 1.0, < 3)
101
+ rails (5.2.6)
102
+ actioncable (= 5.2.6)
103
+ actionmailer (= 5.2.6)
104
+ actionpack (= 5.2.6)
105
+ actionview (= 5.2.6)
106
+ activejob (= 5.2.6)
107
+ activemodel (= 5.2.6)
108
+ activerecord (= 5.2.6)
109
+ activestorage (= 5.2.6)
110
+ activesupport (= 5.2.6)
111
+ bundler (>= 1.3.0)
112
+ railties (= 5.2.6)
113
+ sprockets-rails (>= 2.0.0)
114
+ rails-dom-testing (2.0.3)
115
+ activesupport (>= 4.2.0)
116
+ nokogiri (>= 1.6)
107
117
  rails-html-sanitizer (1.3.0)
108
118
  loofah (~> 2.3)
109
- railties (4.2.11.3)
110
- actionpack (= 4.2.11.3)
111
- activesupport (= 4.2.11.3)
119
+ railties (5.2.6)
120
+ actionpack (= 5.2.6)
121
+ activesupport (= 5.2.6)
122
+ method_source
112
123
  rake (>= 0.8.7)
113
- thor (>= 0.18.1, < 2.0)
114
- rake (13.0.1)
115
- rspec (3.9.0)
116
- rspec-core (~> 3.9.0)
117
- rspec-expectations (~> 3.9.0)
118
- rspec-mocks (~> 3.9.0)
119
- rspec-core (3.9.2)
120
- rspec-support (~> 3.9.3)
121
- rspec-expectations (3.9.2)
124
+ thor (>= 0.19.0, < 2.0)
125
+ rake (13.0.6)
126
+ rspec (3.11.0)
127
+ rspec-core (~> 3.11.0)
128
+ rspec-expectations (~> 3.11.0)
129
+ rspec-mocks (~> 3.11.0)
130
+ rspec-core (3.11.0)
131
+ rspec-support (~> 3.11.0)
132
+ rspec-expectations (3.11.0)
122
133
  diff-lcs (>= 1.2.0, < 2.0)
123
- rspec-support (~> 3.9.0)
124
- rspec-mocks (3.9.1)
134
+ rspec-support (~> 3.11.0)
135
+ rspec-mocks (3.11.0)
125
136
  diff-lcs (>= 1.2.0, < 2.0)
126
- rspec-support (~> 3.9.0)
127
- rspec-rails (3.9.1)
128
- actionpack (>= 3.0)
129
- activesupport (>= 3.0)
130
- railties (>= 3.0)
131
- rspec-core (~> 3.9.0)
132
- rspec-expectations (~> 3.9.0)
133
- rspec-mocks (~> 3.9.0)
134
- rspec-support (~> 3.9.0)
135
- rspec-support (3.9.3)
137
+ rspec-support (~> 3.11.0)
138
+ rspec-rails (5.1.1)
139
+ actionpack (>= 5.2)
140
+ activesupport (>= 5.2)
141
+ railties (>= 5.2)
142
+ rspec-core (~> 3.10)
143
+ rspec-expectations (~> 3.10)
144
+ rspec-mocks (~> 3.10)
145
+ rspec-support (~> 3.10)
146
+ rspec-support (3.11.0)
136
147
  simplecov (0.16.1)
137
148
  docile (~> 1.1)
138
149
  json (>= 1.8, < 3)
139
150
  simplecov-html (~> 0.10.0)
140
151
  simplecov-html (0.10.2)
141
- sprockets (3.7.2)
152
+ sprockets (4.0.2)
142
153
  concurrent-ruby (~> 1.0)
143
154
  rack (> 1, < 3)
144
- sprockets-rails (3.2.1)
155
+ sprockets-rails (3.2.2)
145
156
  actionpack (>= 4.0)
146
157
  activesupport (>= 4.0)
147
158
  sprockets (>= 3.0.0)
148
159
  sync (0.5.0)
149
160
  term-ansicolor (1.7.1)
150
161
  tins (~> 1.0)
151
- thor (1.0.1)
162
+ thor (1.1.0)
152
163
  thread_safe (0.3.6)
153
- tins (1.25.0)
164
+ tins (1.29.1)
154
165
  sync
155
- tzinfo (1.2.7)
166
+ tzinfo (1.2.9)
156
167
  thread_safe (~> 0.1)
168
+ websocket-driver (0.7.5)
169
+ websocket-extensions (>= 0.1.0)
170
+ websocket-extensions (0.1.5)
157
171
 
158
172
  PLATFORMS
159
173
  ruby
@@ -164,10 +178,10 @@ DEPENDENCIES
164
178
  coveralls
165
179
  pry
166
180
  pry-byebug
167
- rails (~> 4.2)
181
+ rails (~> 5.2)
168
182
  rake (~> 13.0)
169
- rspec
170
- rspec-rails (~> 3.0)
183
+ rspec (~> 3.11)
184
+ rspec-rails (~> 5.0)
171
185
 
172
186
  BUNDLED WITH
173
- 1.17.3
187
+ 2.2.29
data/README.md CHANGED
@@ -7,7 +7,7 @@ which was itself a fork of a fork of Nick Pohodnya's original gem for
7
7
  Rails 3, [enum_column3](https://github.com/electronick/enum_column).
8
8
 
9
9
  ## Support
10
- Currently this is tested with Rails version 4.2, 5.2, and 6.0.
10
+ Currently this is tested with Rails version 5.2, and 6.0.
11
11
 
12
12
  **Supported adapters:**
13
13
  - mysql2
data/enum_column.gemspec CHANGED
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
28
28
  end
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency 'activerecord', '>= 4.2', '< 7'
32
- spec.add_dependency 'mysql2', '0.4.5'
31
+ spec.add_dependency 'activerecord', '>= 5.2', '< 7'
32
+ spec.add_dependency 'mysql2', '>= 0.4.5', '< 0.6'
33
33
  end
@@ -9,6 +9,7 @@ gem "pry-byebug"
9
9
  gem "rake", "~> 13.0"
10
10
  gem "rails", "~> 5.2"
11
11
  gem "rspec"
12
- gem "rspec-rails", "~> 3.0"
12
+ gem "rspec-rails", "~> 4.0"
13
+ gem "mysql2", "~> 0.4"
13
14
 
14
15
  gemspec path: "../"
@@ -7,8 +7,10 @@ gem "coveralls", require: false
7
7
  gem "pry"
8
8
  gem "pry-byebug"
9
9
  gem "rake", "~> 13.0"
10
- gem "rails", "~> 6.0"
10
+ gem "rails", "~> 6.0.0"
11
11
  gem "rspec"
12
- gem "rspec-rails", "~> 3.0"
12
+ gem "rspec-rails", "~> 4.0"
13
+ gem "mysql2", "~> 0.5"
14
+ gem "net-smtp", require: false
13
15
 
14
16
  gemspec path: "../"
@@ -22,7 +22,7 @@ module ActiveRecord
22
22
  ActiveRecordColumnWithEnums = Enum.mysql_column_adapter
23
23
 
24
24
  module EnumColumnAdapter
25
- def initialize(*)
25
+ def initialize(*args, **kwargs, &block)
26
26
  super
27
27
 
28
28
  if type == :enum
@@ -28,39 +28,20 @@ module ActiveRecord
28
28
  # be done on a per adapter basis, but is generalized here.
29
29
  #
30
30
  # will generate enum('a', 'b', 'c') for :limit => [:a, :b, :c]
31
- if Rails::VERSION::MAJOR < 5
32
- def type_to_sql(type, limit = nil, *args)
33
- if type.to_s == 'enum'
34
- column_type_sql =
35
- if (native_database_type = native_database_types[type])
36
- native_database_type[:name]
37
- else
38
- 'enum'
39
- end
31
+ def type_to_sql(type, limit: nil, **_options) # :nodoc:
32
+ if type.to_s == 'enum'
33
+ column_type_sql =
34
+ if (native_database_type = native_database_types[type])
35
+ native_database_type[:name]
36
+ else
37
+ 'enum'
38
+ end
40
39
 
41
- quoted_values = limit.map { |v| quote(v) }.join(',')
40
+ quoted_values = limit.map { |v| quote(v) }.join(',')
42
41
 
43
- "#{column_type_sql}(#{quoted_values})"
44
- else
45
- super
46
- end
47
- end
48
- else
49
- def type_to_sql(type, limit: nil, **_options) # :nodoc:
50
- if type.to_s == 'enum'
51
- column_type_sql =
52
- if (native_database_type = native_database_types[type])
53
- native_database_type[:name]
54
- else
55
- 'enum'
56
- end
57
-
58
- quoted_values = limit.map { |v| quote(v) }.join(',')
59
-
60
- "#{column_type_sql}(#{quoted_values})"
61
- else
62
- super
63
- end
42
+ "#{column_type_sql}(#{quoted_values})"
43
+ else
44
+ super
64
45
  end
65
46
  end
66
47
 
@@ -7,21 +7,11 @@ module ActiveRecord
7
7
 
8
8
  # Quote a symbol as a normal string. This will support quoting of
9
9
  # enumerated values.
10
- if Rails::VERSION::MAJOR < 5
11
- def quote(value, column = nil)
12
- if !value.is_a? Symbol
13
- __quote_enum(value, column)
14
- else
15
- ActiveRecord::Base.send(:quote_bound_value, value.to_s)
16
- end
17
- end
18
- else
19
- def quote(value)
20
- if !value.is_a? Symbol
21
- __quote_enum(value)
22
- else
23
- ActiveRecord::Base.send(:quote_bound_value, value.to_s)
24
- end
10
+ def quote(value)
11
+ if !value.is_a? Symbol
12
+ __quote_enum(value)
13
+ else
14
+ ActiveRecord::Base.send(:quote_bound_value, value.to_s)
25
15
  end
26
16
  end
27
17
  end
@@ -6,7 +6,7 @@ module ActiveRecord
6
6
  def enum(*args)
7
7
  options = args.extract_options!
8
8
  column_names = args
9
- column_names.each { |name| column(name, 'enum', options) }
9
+ column_names.each { |name| column(name, 'enum', **options) }
10
10
  end
11
11
  end
12
12
  end
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module Mysql
5
5
  module Enum
6
- VERSION = "1.0.0.pre.2"
6
+ VERSION = "2.0.1.pre.ga.0"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-mysql-enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.2
4
+ version: 2.0.1.pre.ga.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pohodnya
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-15 00:00:00.000000000 Z
12
+ date: 2022-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '4.2'
20
+ version: '5.2'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '7'
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '4.2'
30
+ version: '5.2'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '7'
@@ -35,16 +35,22 @@ dependencies:
35
35
  name: mysql2
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.4.5
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.6'
41
44
  type: :runtime
42
45
  prerelease: false
43
46
  version_requirements: !ruby/object:Gem::Requirement
44
47
  requirements:
45
- - - '='
48
+ - - ">="
46
49
  - !ruby/object:Gem::Version
47
50
  version: 0.4.5
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.6'
48
54
  description: Enable enum type for the MySQL Adapter in ActiveRecord
49
55
  email:
50
56
  - development@invoca.com
@@ -54,9 +60,10 @@ extra_rdoc_files: []
54
60
  files:
55
61
  - ".dependabot/config.yml"
56
62
  - ".github/workflows/gem_release.yml"
63
+ - ".github/workflows/test.yml"
57
64
  - ".gitignore"
58
65
  - ".rspec"
59
- - ".travis.yml"
66
+ - ".ruby-version"
60
67
  - Appraisals
61
68
  - CHANGELOG.md
62
69
  - Gemfile
@@ -67,7 +74,6 @@ files:
67
74
  - app/assets/config/manifest.js
68
75
  - enum_column.gemspec
69
76
  - gemfiles/.bundle/config
70
- - gemfiles/rails_4.gemfile
71
77
  - gemfiles/rails_5.gemfile
72
78
  - gemfiles/rails_6.gemfile
73
79
  - init.rb
@@ -101,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
107
  - !ruby/object:Gem::Version
102
108
  version: 1.3.1
103
109
  requirements: []
104
- rubygems_version: 3.0.1
110
+ rubygems_version: 3.1.6
105
111
  signing_key:
106
112
  specification_version: 4
107
113
  summary: Enable enum type for the MySQL Adapter in ActiveRecord
data/.travis.yml DELETED
@@ -1,29 +0,0 @@
1
- ---
2
- dist: trusty
3
- language: ruby
4
- sudo: false
5
- cache: bundler
6
- rvm:
7
- - 2.4.5
8
- - 2.5.8
9
- - 2.6.5
10
- - 2.7.1
11
- - ruby-head
12
- gemfile:
13
- - gemfiles/rails_4.gemfile
14
- - gemfiles/rails_5.gemfile
15
- - gemfiles/rails_6.gemfile
16
- matrix:
17
- fast_finish: false
18
- exclude:
19
- - gemfile: gemfiles/rails_4.gemfile
20
- rvm: 2.7.1
21
- - gemfile: gemfiles/rails_5.gemfile
22
- rvm: 2.4.5
23
- - gemfile: gemfiles/rails_6.gemfile
24
- rvm: 2.4.5
25
- allow_failures:
26
- - rvm: ruby-head
27
- script:
28
- - RAILS_ENV=test bundle exec rake db:create
29
- - bundle exec rspec
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "coveralls", require: false
7
- gem "pry"
8
- gem "pry-byebug"
9
- gem "rake", "~> 13.0"
10
- gem "rails", "~> 4.2"
11
- gem "rspec"
12
- gem "rspec-rails", "~> 3.0"
13
-
14
- gemspec path: "../"