diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb02621..e5cd6da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,123 +8,47 @@ jobs: gemfile: - Gemfile - gemfiles/Gemfile-rails-main - - gemfiles/Gemfile-rails-6-1 - - gemfiles/Gemfile-rails-6-0 - - gemfiles/Gemfile-rails-5-2 - - gemfiles/Gemfile-rails-5-1 - - gemfiles/Gemfile-rails-5-0 - - gemfiles/Gemfile-rails-4-2 - - gemfiles/Gemfile-rails-4-1 + - gemfiles/Gemfile-rails-8-0 + - gemfiles/Gemfile-rails-7-2 + - gemfiles/Gemfile-rails-7-1 + - gemfiles/Gemfile-rails-7-0 ruby: + - '3.4' + - '3.3' + - '3.2' - '3.1' - '3.0' - '2.7' - - '2.6' - - '2.5' - - '2.4' - - '2.3' - - '2.2' - - '2.1' exclude: - gemfile: Gemfile - ruby: '2.6' - - gemfile: Gemfile - ruby: '2.5' - - gemfile: Gemfile - ruby: '2.4' - - gemfile: Gemfile - ruby: '2.3' - - gemfile: Gemfile - ruby: '2.2' - - gemfile: Gemfile - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.6' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.5' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.4' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.3' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.4' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.3' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-6-0 ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.4' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.3' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-5-1 - ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-5-1 + - gemfile: Gemfile ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-1 + - gemfile: Gemfile ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-5-1 - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-5-0 + - gemfile: gemfiles/Gemfile-rails-main ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-5-0 + - gemfile: gemfiles/Gemfile-rails-main ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-0 + - gemfile: gemfiles/Gemfile-rails-main ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-5-0 - ruby: '2.1' - - gemfile: gemfiles/Gemfile-rails-4-2 + - gemfile: gemfiles/Gemfile-rails-8-0 ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-4-2 + - gemfile: gemfiles/Gemfile-rails-8-0 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-4-2 + - gemfile: gemfiles/Gemfile-rails-8-0 ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-4-2 - ruby: '2.6' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-4-1 + - gemfile: gemfiles/Gemfile-rails-7-2 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-4-1 + - gemfile: gemfiles/Gemfile-rails-7-2 ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.6' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.5' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.4' runs-on: ubuntu-latest env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: ${{ matrix.gemfile }} steps: - - uses: actions/checkout@v2 - - name: Setup Bundler 1.x for Rails 4.x - if: ${{ matrix.gemfile == 'gemfiles/Gemfile-rails-4-1' || matrix.gemfile == 'gemfiles/Gemfile-rails-4-2' }} - run: echo "BUNDLER_VERSION=1.17.3" >> $GITHUB_ENV + - uses: actions/checkout@v5 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs bundle install and caches installed gems automatically - bundler: ${{ env.BUNDLER_VERSION || 'latest' }} - run: bundle exec rake diff --git a/Changelog.md b/Changelog.md index 2b8f903..e88adb5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,7 @@ ### Unreleased -* Support Rails 4.1 - 7.0, dropped support for Rails <= 4.0. (same support as Devise as of v4.8) -* Support Ruby 2.1 - 3.1, dropped support for Ruby <= 2.0. (same support as Devise as of v4.8) +* Support Rails 7 - 8.1, drop support < 7 +* Support Ruby 2.7 - 3.4, drop support < 2.7 ### 0.2.0 diff --git a/Gemfile b/Gemfile index 08b94c6..ad7a308 100644 --- a/Gemfile +++ b/Gemfile @@ -2,8 +2,8 @@ source 'https://rubygems.org' gemspec -gem 'devise', '~> 4.8' -gem 'rails', '~> 7.0.0' +gem 'devise', '~> 5.0.0.beta', github: 'heartcombo/devise', branch: 'main' +gem 'rails', '~> 8.1.0.rc1' gem 'sqlite3' -gem 'mocha', '~> 1.0', require: false +gem 'mocha', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 378bc74..5c4c5eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,15 @@ +GIT + remote: https://github.com/heartcombo/devise.git + revision: 141ef373396a4c19a619a24647bc323dc853c6ac + branch: main + specs: + devise (5.0.0.beta) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 6.0.0) + responders + warden (~> 1.2.3) + PATH remote: . specs: @@ -7,174 +19,213 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.2.2) - actionpack (= 7.0.2.2) - activesupport (= 7.0.2.2) + action_text-trix (2.1.15) + railties + actioncable (8.1.0.rc1) + actionpack (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.2.2) - actionpack (= 7.0.2.2) - activejob (= 7.0.2.2) - activerecord (= 7.0.2.2) - activestorage (= 7.0.2.2) - activesupport (= 7.0.2.2) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.2.2) - actionpack (= 7.0.2.2) - actionview (= 7.0.2.2) - activejob (= 7.0.2.2) - activesupport (= 7.0.2.2) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.2.2) - actionview (= 7.0.2.2) - activesupport (= 7.0.2.2) - rack (~> 2.0, >= 2.2.0) + zeitwerk (~> 2.6) + actionmailbox (8.1.0.rc1) + actionpack (= 8.1.0.rc1) + activejob (= 8.1.0.rc1) + activerecord (= 8.1.0.rc1) + activestorage (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) + mail (>= 2.8.0) + actionmailer (8.1.0.rc1) + actionpack (= 8.1.0.rc1) + actionview (= 8.1.0.rc1) + activejob (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.1.0.rc1) + actionview (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.2.2) - actionpack (= 7.0.2.2) - activerecord (= 7.0.2.2) - activestorage (= 7.0.2.2) - activesupport (= 7.0.2.2) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.1.0.rc1) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.0.rc1) + activerecord (= 8.1.0.rc1) + activestorage (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.2.2) - activesupport (= 7.0.2.2) + actionview (8.1.0.rc1) + activesupport (= 8.1.0.rc1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.2.2) - activesupport (= 7.0.2.2) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.1.0.rc1) + activesupport (= 8.1.0.rc1) globalid (>= 0.3.6) - activemodel (7.0.2.2) - activesupport (= 7.0.2.2) - activerecord (7.0.2.2) - activemodel (= 7.0.2.2) - activesupport (= 7.0.2.2) - activestorage (7.0.2.2) - actionpack (= 7.0.2.2) - activejob (= 7.0.2.2) - activerecord (= 7.0.2.2) - activesupport (= 7.0.2.2) + activemodel (8.1.0.rc1) + activesupport (= 8.1.0.rc1) + activerecord (8.1.0.rc1) + activemodel (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) + timeout (>= 0.4.0) + activestorage (8.1.0.rc1) + actionpack (= 8.1.0.rc1) + activejob (= 8.1.0.rc1) + activerecord (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.2.2) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.1.0.rc1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - bcrypt (3.1.16) - builder (3.2.4) - concurrent-ruby (1.1.9) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + base64 (0.3.0) + bcrypt (3.1.20) + bigdecimal (3.3.1) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) crass (1.0.6) - devise (4.8.1) - bcrypt (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 4.1.0) - responders - warden (~> 1.2.3) - digest (3.1.0) - erubi (1.10.0) - globalid (1.0.0) - activesupport (>= 5.0) - i18n (1.10.0) + date (3.4.1) + drb (2.2.3) + erb (5.1.1) + erubi (1.13.1) + globalid (1.3.0) + activesupport (>= 6.1) + i18n (1.14.7) concurrent-ruby (~> 1.0) - io-wait (0.2.1) - loofah (2.14.0) + io-console (0.8.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.15.1) + logger (1.7.0) + loofah (2.24.1) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.15.0) - mocha (1.13.0) - net-imap (0.2.3) - digest + net-imap + net-pop + net-smtp + marcel (1.1.0) + mini_mime (1.1.5) + mini_portile2 (2.8.9) + minitest (5.26.0) + mocha (2.7.1) + ruby2_keywords (>= 0.0.5) + net-imap (0.5.12) + date net-protocol - strscan - net-pop (0.1.1) - digest + net-pop (0.1.2) net-protocol + net-protocol (0.2.2) timeout - net-protocol (0.1.2) - io-wait - timeout - net-smtp (0.3.1) - digest + net-smtp (0.5.1) net-protocol - timeout - nio4r (2.5.8) - nokogiri (1.13.3) - mini_portile2 (~> 2.8.0) + nio4r (2.7.4) + nokogiri (1.18.10) + mini_portile2 (~> 2.8.2) racc (~> 1.4) orm_adapter (0.5.0) - racc (1.6.0) - rack (2.2.3) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (7.0.2.2) - actioncable (= 7.0.2.2) - actionmailbox (= 7.0.2.2) - actionmailer (= 7.0.2.2) - actionpack (= 7.0.2.2) - actiontext (= 7.0.2.2) - actionview (= 7.0.2.2) - activejob (= 7.0.2.2) - activemodel (= 7.0.2.2) - activerecord (= 7.0.2.2) - activestorage (= 7.0.2.2) - activesupport (= 7.0.2.2) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + psych (5.2.6) + date + stringio + racc (1.8.1) + rack (3.2.3) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails (8.1.0.rc1) + actioncable (= 8.1.0.rc1) + actionmailbox (= 8.1.0.rc1) + actionmailer (= 8.1.0.rc1) + actionpack (= 8.1.0.rc1) + actiontext (= 8.1.0.rc1) + actionview (= 8.1.0.rc1) + activejob (= 8.1.0.rc1) + activemodel (= 8.1.0.rc1) + activerecord (= 8.1.0.rc1) + activestorage (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) bundler (>= 1.15.0) - railties (= 7.0.2.2) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 8.1.0.rc1) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) - railties (7.0.2.2) - actionpack (= 7.0.2.2) - activesupport (= 7.0.2.2) - method_source + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.1.0.rc1) + actionpack (= 8.1.0.rc1) + activesupport (= 8.1.0.rc1) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rake (13.0.6) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) - sqlite3 (1.4.2) - strscan (3.0.1) - thor (1.2.1) - timeout (0.2.0) - tzinfo (2.0.4) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rake (13.3.0) + rdoc (6.15.0) + erb + psych (>= 4.0.0) + tsort + reline (0.6.2) + io-console (~> 0.5) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + ruby2_keywords (0.0.5) + securerandom (0.4.1) + sqlite3 (2.7.4) + mini_portile2 (~> 2.8.0) + stringio (3.1.7) + thor (1.4.0) + timeout (0.4.3) + tsort (0.2.0) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) + uri (1.0.4) + useragent (0.16.11) warden (1.2.9) rack (>= 2.0.9) - websocket-driver (0.7.5) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.5.4) + zeitwerk (2.7.3) PLATFORMS ruby DEPENDENCIES - devise (~> 4.8) + devise (~> 5.0.0.beta)! devise-encryptable! - mocha (~> 1.0) - rails (~> 7.0.0) + mocha + rails (~> 8.1.0.rc1) sqlite3 BUNDLED WITH diff --git a/gemfiles/Gemfile-rails-4-1 b/gemfiles/Gemfile-rails-4-1 deleted file mode 100644 index bb390f4..0000000 --- a/gemfiles/Gemfile-rails-4-1 +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gem 'devise-encryptable', path: '..' - -gem 'devise', '~> 4.8' -gem 'rails', '~> 4.1.0' -gem 'sqlite3', '~> 1.3.6' - -gem 'mocha', '~> 1.0', require: false diff --git a/gemfiles/Gemfile-rails-4-2 b/gemfiles/Gemfile-rails-4-2 deleted file mode 100644 index 6af6ef7..0000000 --- a/gemfiles/Gemfile-rails-4-2 +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gem 'devise-encryptable', path: '..' - -gem 'devise', '~> 4.8' -gem 'rails', '~> 4.2.0' -gem 'sqlite3', '~> 1.3.6' - -gem 'mocha', '~> 1.0', require: false diff --git a/gemfiles/Gemfile-rails-5-0 b/gemfiles/Gemfile-rails-5-0 deleted file mode 100644 index 2516f46..0000000 --- a/gemfiles/Gemfile-rails-5-0 +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gem 'devise-encryptable', path: '..' - -gem 'devise', '~> 4.8' -gem 'rails', '~> 5.0.0' -gem 'sqlite3', '~> 1.3.6' - -gem 'mocha', '~> 1.0', require: false diff --git a/gemfiles/Gemfile-rails-5-1 b/gemfiles/Gemfile-rails-5-1 deleted file mode 100644 index 9a515b2..0000000 --- a/gemfiles/Gemfile-rails-5-1 +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gem 'devise-encryptable', path: '..' - -gem 'devise', '~> 4.8' -gem 'rails', '~> 5.1.0' -gem 'sqlite3' - -gem 'mocha', '~> 1.0', require: false diff --git a/gemfiles/Gemfile-rails-7-0 b/gemfiles/Gemfile-rails-7-0 new file mode 100644 index 0000000..81a4e46 --- /dev/null +++ b/gemfiles/Gemfile-rails-7-0 @@ -0,0 +1,9 @@ +source 'https://rubygems.org' + +gem 'devise-encryptable', path: '..' + +gem 'devise', '~> 4.8' +gem 'rails', '~> 7.0.0', github: 'rails/rails', branch: '7-0-stable' +gem 'sqlite3', '~> 1.4' + +gem 'mocha', require: false diff --git a/gemfiles/Gemfile-rails-5-2 b/gemfiles/Gemfile-rails-7-1 similarity index 63% rename from gemfiles/Gemfile-rails-5-2 rename to gemfiles/Gemfile-rails-7-1 index 28a61d1..15e4fee 100644 --- a/gemfiles/Gemfile-rails-5-2 +++ b/gemfiles/Gemfile-rails-7-1 @@ -3,7 +3,7 @@ source 'https://rubygems.org' gem 'devise-encryptable', path: '..' gem 'devise', '~> 4.8' -gem 'rails', '~> 5.2.0' +gem 'rails', '~> 7.1.0' gem 'sqlite3' -gem 'mocha', '~> 1.0', require: false +gem 'mocha', require: false diff --git a/gemfiles/Gemfile-rails-6-0 b/gemfiles/Gemfile-rails-7-2 similarity index 63% rename from gemfiles/Gemfile-rails-6-0 rename to gemfiles/Gemfile-rails-7-2 index dd60945..37aee09 100644 --- a/gemfiles/Gemfile-rails-6-0 +++ b/gemfiles/Gemfile-rails-7-2 @@ -3,7 +3,7 @@ source 'https://rubygems.org' gem 'devise-encryptable', path: '..' gem 'devise', '~> 4.8' -gem 'rails', '~> 6.0.0' +gem 'rails', '~> 7.2.0' gem 'sqlite3' -gem 'mocha', '~> 1.0', require: false +gem 'mocha', require: false diff --git a/gemfiles/Gemfile-rails-6-1 b/gemfiles/Gemfile-rails-8-0 similarity index 63% rename from gemfiles/Gemfile-rails-6-1 rename to gemfiles/Gemfile-rails-8-0 index 6a79bd1..f5950c9 100644 --- a/gemfiles/Gemfile-rails-6-1 +++ b/gemfiles/Gemfile-rails-8-0 @@ -3,7 +3,7 @@ source 'https://rubygems.org' gem 'devise-encryptable', path: '..' gem 'devise', '~> 4.8' -gem 'rails', '~> 6.1.0' +gem 'rails', '~> 8.0.0' gem 'sqlite3' -gem 'mocha', '~> 1.0', require: false +gem 'mocha', require: false diff --git a/gemfiles/Gemfile-rails-main b/gemfiles/Gemfile-rails-main index 49926a7..385670b 100644 --- a/gemfiles/Gemfile-rails-main +++ b/gemfiles/Gemfile-rails-main @@ -6,4 +6,4 @@ gem 'devise', github: 'heartcombo/devise', branch: 'main' gem 'rails', github: 'rails/rails', branch: 'main' gem 'sqlite3' -gem 'mocha', '~> 1.0', require: false +gem 'mocha', require: false diff --git a/test/rails_app/db/migrate/20120508165529_create_tables.rb b/test/rails_app/db/migrate/20120508165529_create_tables.rb index 463a52f..56e7605 100644 --- a/test/rails_app/db/migrate/20120508165529_create_tables.rb +++ b/test/rails_app/db/migrate/20120508165529_create_tables.rb @@ -1,9 +1,5 @@ -superclass = ActiveRecord::Migration -# TODO: Inherit from the 5.0 Migration class directly when we drop support for Rails 4. -superclass = ActiveRecord::Migration[5.0] if superclass.respond_to?(:[]) - -class CreateTables < superclass - def self.up +class CreateTables < ActiveRecord::Migration[7.0] + def up create_table :users do |t| t.string :username t.string :facebook_token @@ -74,7 +70,7 @@ def self.up end end - def self.down + def down drop_table :users drop_table :admins end diff --git a/test/test_helper.rb b/test/test_helper.rb index a4558c5..8123e66 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,7 +7,7 @@ require "rails_app/config/environment" require "rails/test_help" -require "mocha/setup" +require "mocha/minitest" require 'support/assertions' require 'support/factories' @@ -21,10 +21,8 @@ ActiveRecord::Base.logger = Logger.new(nil) migrate_path = File.expand_path("rails_app/db/migrate/", __dir__) -if Rails::VERSION::MAJOR >= 6 +if Rails.version.start_with? '7.0' ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate -elsif Rails.version.start_with? '5.2' - ActiveRecord::MigrationContext.new(migrate_path).migrate else - ActiveRecord::Migrator.migrate(migrate_path) + ActiveRecord::MigrationContext.new(migrate_path).migrate end