activerecord-mysql-enum 1.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +49 -0
- data/.ruby-version +1 -0
- data/Appraisals +3 -5
- data/CHANGELOG.md +13 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +118 -104
- data/README.md +1 -1
- data/enum_column.gemspec +2 -2
- data/gemfiles/rails_5.gemfile +2 -1
- data/gemfiles/rails_6.gemfile +4 -2
- data/lib/active_record/mysql/enum/enum_column_adapter.rb +1 -1
- data/lib/active_record/mysql/enum/mysql_adapter.rb +12 -31
- data/lib/active_record/mysql/enum/quoting.rb +5 -15
- data/lib/active_record/mysql/enum/schema_definitions.rb +1 -1
- data/lib/active_record/mysql/enum/version.rb +1 -1
- metadata +15 -9
- data/.travis.yml +0 -29
- data/gemfiles/rails_4.gemfile +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2084948247375121f6afd7e4c37a3d80b71370d301de92801bbe8c8659a359a1
|
4
|
+
data.tar.gz: 2f9c5a9fafb6ea306ec68fc7fcbfd7d1c0aa160990e2cff428ea6460088c9f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628fae94acef21e4d62a3c603c16924669f3f85118e1cb66c40ea6338c9273abb33aafc63d4e0e0c174143f2e53ae97da1b3e8bac2b55b3fb3721e87a76e6cce
|
7
|
+
data.tar.gz: '04157914bbeda6f17243216409fa612e357f643c6694c824551eaf4624e1b7d07ffd150b5f6d4c43dbb3acf57ebcb574af3b5737ac438692b5f7b813d4216312'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
name: ActiveRecord MySQL Enum
|
3
|
+
on: [push]
|
4
|
+
jobs:
|
5
|
+
test:
|
6
|
+
name: 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, '3.0', 3.1]
|
23
|
+
gemfile:
|
24
|
+
- Gemfile
|
25
|
+
- gemfiles/rails_5.gemfile
|
26
|
+
- gemfiles/rails_6.gemfile
|
27
|
+
exclude:
|
28
|
+
- ruby: '3.0'
|
29
|
+
gemfile: Gemfile
|
30
|
+
- ruby: 3.1
|
31
|
+
gemfile: Gemfile
|
32
|
+
- ruby: '3.0'
|
33
|
+
gemfile: gemfiles/rails_5.gemfile
|
34
|
+
- ruby: 3.1
|
35
|
+
gemfile: gemfiles/rails_5.gemfile
|
36
|
+
env:
|
37
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
38
|
+
DATABASE_MYSQL_HOST: 127.0.0.1
|
39
|
+
DATABASE_MYSQL_USERNAME: user
|
40
|
+
DATABASE_MYSQL_PASSWORD: password
|
41
|
+
steps:
|
42
|
+
- uses: actions/checkout@v2
|
43
|
+
- uses: ruby/setup-ruby@v1
|
44
|
+
with:
|
45
|
+
ruby-version: ${{ matrix.ruby }}
|
46
|
+
bundler: 2.2.29
|
47
|
+
bundler-cache: true
|
48
|
+
- run: RAILS_ENV=test bundle exec rake db:create
|
49
|
+
- 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,6 +4,17 @@ 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
|
+
## [2.1.0] - 2022-04-11
|
8
|
+
### Added
|
9
|
+
- Added ruby 3 support
|
10
|
+
|
11
|
+
### Removed
|
12
|
+
- Dropped support for Rails less than 5
|
13
|
+
|
14
|
+
## [2.0.0] - 2021-08-10
|
15
|
+
### Removed
|
16
|
+
- Dropped support for Rails less than 5
|
17
|
+
|
7
18
|
## [1.0.0] - 2020-09-16
|
8
19
|
### Added
|
9
20
|
- A Rspec test suit
|
@@ -45,6 +56,8 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
|
|
45
56
|
### Changed
|
46
57
|
- Renamed the gem from `enum_column3` to `activerecord-mysql-enum`
|
47
58
|
|
59
|
+
[2.1.0]: https://github.com/Invoca/activerecord-mysql-enum/compare/v2.0.0...v2.1.0
|
60
|
+
[2.0.0]: https://github.com/Invoca/activerecord-mysql-enum/compare/v1.0.0...v2.0.0
|
48
61
|
[1.0.0]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.4...v1.0.0
|
49
62
|
[0.1.4]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.3...v0.1.4
|
50
63
|
[0.1.3]: https://github.com/Invoca/activerecord-mysql-enum/compare/v0.1.2...v0.1.3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,56 +1,63 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
activerecord-mysql-enum (1.0
|
5
|
-
activerecord (>=
|
6
|
-
mysql2 (
|
4
|
+
activerecord-mysql-enum (2.1.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
|
-
|
12
|
-
actionpack (=
|
13
|
-
|
14
|
-
|
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 (~>
|
17
|
-
actionpack (
|
18
|
-
actionview (=
|
19
|
-
activesupport (=
|
20
|
-
rack (~>
|
21
|
-
rack-test (
|
22
|
-
rails-dom-testing (~>
|
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 (
|
25
|
-
activesupport (=
|
28
|
+
actionview (5.2.6)
|
29
|
+
activesupport (= 5.2.6)
|
26
30
|
builder (~> 3.1)
|
27
|
-
|
28
|
-
rails-dom-testing (~>
|
31
|
+
erubi (~> 1.4)
|
32
|
+
rails-dom-testing (~> 2.0)
|
29
33
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
30
|
-
activejob (
|
31
|
-
activesupport (=
|
32
|
-
globalid (>= 0.3.
|
33
|
-
activemodel (
|
34
|
-
activesupport (=
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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.
|
52
|
+
appraisal (2.4.1)
|
46
53
|
bundler
|
47
54
|
rake
|
48
55
|
thor (>= 0.14.0)
|
49
|
-
arel (
|
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.
|
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.
|
62
|
-
docile (1.
|
63
|
-
|
64
|
-
globalid (0.
|
65
|
-
activesupport (>=
|
66
|
-
i18n (
|
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.
|
69
|
-
loofah (2.
|
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
|
76
|
-
mini_portile2 (2.
|
77
|
-
minitest (5.14.
|
78
|
-
mysql2 (0.
|
79
|
-
|
80
|
-
|
81
|
-
|
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.
|
94
|
+
pry-byebug (3.8.0)
|
85
95
|
byebug (~> 11.0)
|
86
|
-
pry (~> 0.
|
87
|
-
|
88
|
-
rack
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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 (
|
110
|
-
actionpack (=
|
111
|
-
activesupport (=
|
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.
|
114
|
-
rake (13.0.
|
115
|
-
rspec (3.
|
116
|
-
rspec-core (~> 3.
|
117
|
-
rspec-expectations (~> 3.
|
118
|
-
rspec-mocks (~> 3.
|
119
|
-
rspec-core (3.
|
120
|
-
rspec-support (~> 3.
|
121
|
-
rspec-expectations (3.
|
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.
|
124
|
-
rspec-mocks (3.
|
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.
|
127
|
-
rspec-rails (
|
128
|
-
actionpack (>=
|
129
|
-
activesupport (>=
|
130
|
-
railties (>=
|
131
|
-
rspec-core (~> 3.
|
132
|
-
rspec-expectations (~> 3.
|
133
|
-
rspec-mocks (~> 3.
|
134
|
-
rspec-support (~> 3.
|
135
|
-
rspec-support (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 (
|
152
|
+
sprockets (4.0.2)
|
142
153
|
concurrent-ruby (~> 1.0)
|
143
154
|
rack (> 1, < 3)
|
144
|
-
sprockets-rails (3.2.
|
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
|
162
|
+
thor (1.1.0)
|
152
163
|
thread_safe (0.3.6)
|
153
|
-
tins (1.
|
164
|
+
tins (1.29.1)
|
154
165
|
sync
|
155
|
-
tzinfo (1.2.
|
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 (~>
|
181
|
+
rails (~> 5.2)
|
168
182
|
rake (~> 13.0)
|
169
|
-
rspec
|
170
|
-
rspec-rails (~>
|
183
|
+
rspec (~> 3.11)
|
184
|
+
rspec-rails (~> 5.0)
|
171
185
|
|
172
186
|
BUNDLED WITH
|
173
|
-
|
187
|
+
2.3.11
|
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
|
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', '>=
|
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
|
data/gemfiles/rails_5.gemfile
CHANGED
data/gemfiles/rails_6.gemfile
CHANGED
@@ -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", "~>
|
12
|
+
gem "rspec-rails", "~> 4.0"
|
13
|
+
gem "mysql2", "~> 0.5"
|
14
|
+
gem "net-smtp", require: false
|
13
15
|
|
14
16
|
gemspec path: "../"
|
@@ -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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
40
|
+
quoted_values = limit.map { |v| quote(v) }.join(',')
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
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
|
4
|
+
version: 2.1.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:
|
12
|
+
date: 2022-04-11 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: '
|
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: '
|
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
|
-
- ".
|
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: '0'
|
103
109
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.3.11
|
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
|
data/gemfiles/rails_4.gemfile
DELETED
@@ -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: "../"
|