Skip to content

Commit 89ef76e

Browse files
authored
Rails 7 support (#33)
* First pass * Update to support Rails 7 * Clean up version testing * Update dependency location * Update to support multiple Rails versions * Update tests.yml * Update abstract_mysql.rb
1 parent 125512d commit 89ef76e

22 files changed

Lines changed: 119 additions & 91 deletions

.env.local

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_URL="mysql2://root:@mysql/"

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
strategy:
1111
matrix:
1212
ruby:
13-
- '2.7'
1413
- '3.0'
1514
- '3.1'
1615
- '3.2'
16+
- '3.3'
1717
rails:
18-
- '6.0'
1918
- '6.1'
20-
19+
- '7.0'
20+
- '7.1'
2121
runs-on: ubuntu-latest
2222

2323
name: RSpec (Rails ${{ matrix.rails }}) (Ruby ${{ matrix.ruby }})

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
.rspec_status
1212

1313
gemfiles/*.lock
14+
.env.local

Appraisals

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
appraise "rails-6.0" do
2-
gem "rails", "~> 6.0.0"
1+
appraise "rails-6.1" do
2+
gem "rails", "~> 6.1"
33
end
44

5-
appraise "rails-6.1" do
6-
gem "rails", "~> 6.1.0"
5+
appraise "rails-7.0" do
6+
gem "rails", "~> 7.0"
77
end
88

9-
# Rails 7.0 doesn't work yet
10-
# appraise "rails-7.0" do
11-
# gem "rails", "~> 7.0"
12-
# end
9+
appraise "rails-7.1" do
10+
gem "rails", "~> 7.1"
11+
end

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ RUN mkdir -p lib/sql_enum gemfiles
66
COPY lib/sql_enum/version.rb ./lib/sql_enum/
77
COPY gemfiles/*.gemfile gemfiles/
88
COPY sql_enum.gemspec Gemfile Gemfile.lock Appraisals ./
9-
RUN bundle install && exec appraisal install
9+
RUN bundle install && \
10+
bundle exec appraisal install

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
44

55
# Specify your gem's dependencies in sql_enum.gemspec
66
gemspec

Gemfile.lock

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
11
PATH
22
remote: .
33
specs:
4-
sql_enum (0.4.0)
5-
activerecord (>= 6.0, < 7.0)
6-
activesupport (>= 6.0, < 7.0)
4+
sql_enum (1.0.0)
5+
activerecord (>= 6.1.0)
6+
activesupport (>= 6.1.0)
77
mysql2
88

99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
activemodel (6.1.7.6)
13-
activesupport (= 6.1.7.6)
14-
activerecord (6.1.7.6)
15-
activemodel (= 6.1.7.6)
16-
activesupport (= 6.1.7.6)
17-
activesupport (6.1.7.6)
12+
activemodel (7.0.8)
13+
activesupport (= 7.0.8)
14+
activerecord (7.0.8)
15+
activemodel (= 7.0.8)
16+
activesupport (= 7.0.8)
17+
activesupport (7.0.8)
1818
concurrent-ruby (~> 1.0, >= 1.0.2)
1919
i18n (>= 1.6, < 2)
2020
minitest (>= 5.1)
2121
tzinfo (~> 2.0)
22-
zeitwerk (~> 2.3)
2322
appraisal (2.5.0)
2423
bundler
2524
rake
2625
thor (>= 0.14.0)
27-
concurrent-ruby (1.2.2)
28-
debug (1.8.0)
29-
irb (>= 1.5.0)
30-
reline (>= 0.3.1)
26+
awesome_print (1.9.2)
27+
concurrent-ruby (1.2.3)
28+
debug (1.9.1)
29+
irb (~> 1.10)
30+
reline (>= 0.3.8)
3131
diff-lcs (1.5.0)
3232
i18n (1.14.1)
3333
concurrent-ruby (~> 1.0)
34-
io-console (0.6.0)
35-
irb (1.7.4)
36-
reline (>= 0.3.6)
37-
minitest (5.19.0)
34+
io-console (0.7.2)
35+
irb (1.11.1)
36+
rdoc
37+
reline (>= 0.4.2)
38+
minitest (5.21.2)
3839
mysql2 (0.5.5)
39-
rake (13.0.6)
40-
reline (0.3.8)
40+
psych (5.1.2)
41+
stringio
42+
rake (13.1.0)
43+
rdoc (6.6.2)
44+
psych (>= 4.0.0)
45+
reline (0.4.2)
4146
io-console (~> 0.5)
4247
rspec (3.12.0)
4348
rspec-core (~> 3.12.0)
@@ -52,22 +57,23 @@ GEM
5257
diff-lcs (>= 1.2.0, < 2.0)
5358
rspec-support (~> 3.12.0)
5459
rspec-support (3.12.1)
55-
thor (1.2.2)
60+
stringio (3.1.0)
61+
thor (1.3.0)
5662
tzinfo (2.0.6)
5763
concurrent-ruby (~> 1.0)
58-
zeitwerk (2.6.11)
5964

6065
PLATFORMS
6166
ruby
6267
x86_64-linux
6368

6469
DEPENDENCIES
6570
appraisal
71+
awesome_print
6672
bundler
6773
debug
6874
rake (~> 13.0)
6975
rspec (~> 3.0)
7076
sql_enum!
7177

7278
BUNDLED WITH
73-
2.2.30
79+
2.5.5

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Enables usage of native sql enums with ActiveRecord
44

5+
## NOTE
6+
7+
Version 1.0 of this is compatible with Rails 7 and above.
8+
9+
For Rails versions below Rails 7, use version 0.4
10+
511
## Installation
612

713
Add this line to your application's Gemfile:

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ services:
1212

1313
mysql:
1414
image: mysql:5.7
15+
platform: linux/amd64
1516
environment:
1617
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
1718
- MYSQL_DATABASE
1819
- MYSQL_USER
1920
- MYSQL_PASSWORD
2021
healthcheck:
21-
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
22+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
2223
timeout: 20s
2324
retries: 10

gemfiles/rails_5.2.gemfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)