From 46777c0457ce53573b7a306831145e9cff93f8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= <39093711+a-chacon@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:50:34 -0400 Subject: [PATCH] ci: test the package on different rails versions ruby >= 3.1 and rails >= 7.0.0 --- .github/workflows/rubyonrails.yml | 27 +-- .rubocop.yml | 3 + .ruby-version | 2 +- Gemfile | 2 + Gemfile.lock | 214 ++++++++++-------- gemfiles/rails-7.0.gemfile | 28 +++ gemfiles/rails-7.1.gemfile | 28 +++ gemfiles/rails-7.2.gemfile | 28 +++ lib/oas_rails/spec/specable.rb | 4 +- oas_rails.gemspec | 4 +- test/dummy/.ruby-version | 1 - test/dummy/Gemfile | 5 - test/dummy/Gemfile.lock | 86 ------- test/dummy/config/application.rb | 12 +- test/dummy/config/environments/development.rb | 1 - test/dummy/config/environments/test.rb | 1 - .../db/migrate/20240712004600_create_users.rb | 2 +- .../migrate/20240718211538_create_projects.rb | 2 +- test/dummy/db/schema.rb | 2 +- 19 files changed, 239 insertions(+), 213 deletions(-) create mode 100644 gemfiles/rails-7.0.gemfile create mode 100644 gemfiles/rails-7.1.gemfile create mode 100644 gemfiles/rails-7.2.gemfile delete mode 100644 test/dummy/.ruby-version diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index 6fb22b0..6a1dc46 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -7,36 +7,27 @@ name: "Ruby on Rails CI" on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: test: + strategy: + fail-fast: false + matrix: + gemfile: [rails-7.0, rails-7.1, rails-7.2] runs-on: ubuntu-latest - # services: - # postgres: - # image: postgres:11-alpine - # ports: - # - "5432:5432" - # env: - # POSTGRES_DB: rails_test - # POSTGRES_USER: rails - # POSTGRES_PASSWORD: password env: RAILS_ENV: test - # DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test" + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: - name: Checkout code uses: actions/checkout@v4 - # Add or replace dependency steps here - name: Install Ruby and gems uses: ruby/setup-ruby@v1 with: + ruby-version: "3.1" bundler-cache: true - # Add or replace database setup steps here - #- name: Set up database schema - # run: bin/rails db:schema:load - # Add or replace test runners here - name: Run tests run: bin/rails t @@ -57,4 +48,4 @@ jobs: - name: Security audit application code run: brakeman -q -w2 - name: Lint Ruby files - run: rubocop --parallel + run: bundle exec rubocop --parallel diff --git a/.rubocop.yml b/.rubocop.yml index 137a8e2..8180255 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,3 +2,6 @@ inherit_from: .rubocop_todo.yml AllCops: TargetRubyVersion: NewCops: enable + Exclude: + - "gemfiles/*" + - "vendor/**/*" diff --git a/.ruby-version b/.ruby-version index bea438e..fd2a018 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.1 +3.1.0 diff --git a/Gemfile b/Gemfile index ed61e11..f9a74d8 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,8 @@ gem 'sprockets-rails' gem 'rack-cors' group :development, :test do + gem "rubocop" + gem "bcrypt", "~> 3.1.7" gem 'factory_bot_rails' diff --git a/Gemfile.lock b/Gemfile.lock index 95ff047..d02c9db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,103 +2,90 @@ PATH remote: . specs: oas_rails (0.4.1) - esquema (~> 0.1.2) method_source (~> 1.0) - rails (~> 7.0, >= 7.0.0) + model-to-schema (~> 0.1.1) + rails (~> 7.0.0) yard (~> 0.9) GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.0.8.4) + actionpack (= 7.0.8.4) + activesupport (= 7.0.8.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionmailbox (7.0.8.4) + actionpack (= 7.0.8.4) + activejob (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionmailer (7.0.8.4) + actionpack (= 7.0.8.4) + actionview (= 7.0.8.4) + activejob (= 7.0.8.4) + activesupport (= 7.0.8.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) - nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4) - rack-session (>= 1.0.1) + rails-dom-testing (~> 2.0) + actionpack (7.0.8.4) + actionview (= 7.0.8.4) + activesupport (= 7.0.8.4) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.8.4) + actionpack (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.0.8.4) + activesupport (= 7.0.8.4) builder (~> 3.1) - erubi (~> 1.11) - rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.8.4) + activesupport (= 7.0.8.4) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) - timeout (>= 0.4.0) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.0.8.4) + activesupport (= 7.0.8.4) + activerecord (7.0.8.4) + activemodel (= 7.0.8.4) + activesupport (= 7.0.8.4) + activestorage (7.0.8.4) + actionpack (= 7.0.8.4) + activejob (= 7.0.8.4) + activerecord (= 7.0.8.4) + activesupport (= 7.0.8.4) marcel (~> 1.0) - activesupport (7.1.3.4) - base64 - bigdecimal + mini_mime (>= 1.1.0) + activesupport (7.0.8.4) concurrent-ruby (~> 1.0, >= 1.0.2) - connection_pool (>= 2.2.5) - drb i18n (>= 1.6, < 2) minitest (>= 5.1) - mutex_m tzinfo (~> 2.0) + ast (2.4.2) base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.8) builder (3.3.0) - concurrent-ruby (1.3.3) - connection_pool (2.4.1) + concurrent-ruby (1.3.4) crass (1.0.6) date (3.3.4) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) - drb (2.2.1) erubi (1.13.0) - esquema (0.1.2) - activerecord (~> 7.1) factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) @@ -114,8 +101,10 @@ GEM irb (1.14.0) rdoc (>= 4.0.0) reline (>= 0.4.2) + json (2.7.2) jwt (2.8.2) base64 + language_server-protocol (3.17.0.3) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -128,7 +117,8 @@ GEM method_source (1.1.0) mini_mime (1.1.5) minitest (5.24.1) - mutex_m (0.2.0) + model-to-schema (0.1.1) + activerecord (~> 7.0) net-imap (0.4.14) date net-protocol @@ -139,37 +129,46 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) + nokogiri (1.16.7-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86-linux) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-darwin) + racc (~> 1.4) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) + parallel (1.26.2) + parser (3.3.4.2) + ast (~> 2.4.1) + racc psych (5.1.2) stringio puma (6.4.2) nio4r (~> 2.0) - racc (1.8.0) - rack (3.1.7) + racc (1.8.1) + rack (2.2.9) rack-cors (2.0.2) rack (>= 2.0.0) - rack-session (2.0.0) - rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (2.1.0) - rack (>= 3) - webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.0.8.4) + actioncable (= 7.0.8.4) + actionmailbox (= 7.0.8.4) + actionmailer (= 7.0.8.4) + actionpack (= 7.0.8.4) + actiontext (= 7.0.8.4) + actionview (= 7.0.8.4) + activejob (= 7.0.8.4) + activemodel (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.0.8.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -177,40 +176,68 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - irb - rackup (>= 1.0.0) + railties (7.0.8.4) + actionpack (= 7.0.8.4) + activesupport (= 7.0.8.4) + method_source rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) + regexp_parser (2.9.2) reline (0.5.9) io-console (~> 0.5) + rexml (3.3.5) + strscan + rubocop (1.65.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.0) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.5.1) + sprockets-rails (3.5.2) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) + sqlite3 (1.7.3-aarch64-linux) + sqlite3 (1.7.3-arm-linux) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86-linux) + sqlite3 (1.7.3-x86_64-darwin) sqlite3 (1.7.3-x86_64-linux) stringio (3.1.1) + strscan (3.1.0) thor (1.3.1) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - webrick (1.8.1) + unicode-display_width (2.5.0) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) yard (0.9.36) - zeitwerk (2.6.16) + zeitwerk (2.6.17) PLATFORMS + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin x86_64-linux DEPENDENCIES @@ -222,6 +249,7 @@ DEPENDENCIES oas_rails! puma rack-cors + rubocop sprockets-rails sqlite3 (~> 1.4) diff --git a/gemfiles/rails-7.0.gemfile b/gemfiles/rails-7.0.gemfile new file mode 100644 index 0000000..25f9194 --- /dev/null +++ b/gemfiles/rails-7.0.gemfile @@ -0,0 +1,28 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rails', '~> 7.0.0' + +gem 'model-to-schema', '~> 0.1.0' + +gem 'method_source', '~> 1.0' + +gem 'yard', '~> 0.9' + +gem 'puma' + +gem 'sqlite3', "~> 1.4" + +gem 'sprockets-rails' + +gem 'rack-cors' + +group :development, :test do + gem "bcrypt", "~> 3.1.7" + + gem 'factory_bot_rails' + + gem 'jwt' + + gem 'faker' +end diff --git a/gemfiles/rails-7.1.gemfile b/gemfiles/rails-7.1.gemfile new file mode 100644 index 0000000..e588a32 --- /dev/null +++ b/gemfiles/rails-7.1.gemfile @@ -0,0 +1,28 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rails', '~> 7.1.0' + +gem 'model-to-schema', '~> 0.1.0' + +gem 'method_source', '~> 1.0' + +gem 'yard', '~> 0.9' + +gem 'puma' + +gem 'sqlite3', "~> 1.4" + +gem 'sprockets-rails' + +gem 'rack-cors' + +group :development, :test do + gem "bcrypt", "~> 3.1.7" + + gem 'factory_bot_rails' + + gem 'jwt' + + gem 'faker' +end diff --git a/gemfiles/rails-7.2.gemfile b/gemfiles/rails-7.2.gemfile new file mode 100644 index 0000000..f0321f3 --- /dev/null +++ b/gemfiles/rails-7.2.gemfile @@ -0,0 +1,28 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rails', '~> 7.2.0' + +gem 'model-to-schema', '~> 0.1.0' + +gem 'method_source', '~> 1.0' + +gem 'yard', '~> 0.9' + +gem 'puma' + +gem 'sqlite3', "~> 1.4" + +gem 'sprockets-rails' + +gem 'rack-cors' + +group :development, :test do + gem "bcrypt", "~> 3.1.7" + + gem 'factory_bot_rails' + + gem 'jwt' + + gem 'faker' +end diff --git a/lib/oas_rails/spec/specable.rb b/lib/oas_rails/spec/specable.rb index 96425ea..8ee47cd 100644 --- a/lib/oas_rails/spec/specable.rb +++ b/lib/oas_rails/spec/specable.rb @@ -35,9 +35,11 @@ def to_spec hash end - def as_json + # rubocop:disable Lint/UnusedMethodArgument + def as_json(options = nil) to_spec end + # rubocop:enable Lint/UnusedMethodArgument private diff --git a/oas_rails.gemspec b/oas_rails.gemspec index dbfcc8b..65113d1 100644 --- a/oas_rails.gemspec +++ b/oas_rails.gemspec @@ -22,8 +22,8 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 3.1" - spec.add_dependency 'esquema', '~> 0.1.2' spec.add_dependency 'method_source', '~> 1.0' - spec.add_dependency 'rails', "~> 7.0", '>= 7.0.0' + spec.add_dependency 'model-to-schema', '~> 0.1.1' + spec.add_dependency 'rails', '~> 7.0.0' spec.add_dependency 'yard', '~> 0.9' end diff --git a/test/dummy/.ruby-version b/test/dummy/.ruby-version deleted file mode 100644 index bea438e..0000000 --- a/test/dummy/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.3.1 diff --git a/test/dummy/Gemfile b/test/dummy/Gemfile index 300ca6e..d9b09a1 100644 --- a/test/dummy/Gemfile +++ b/test/dummy/Gemfile @@ -1,10 +1,5 @@ source 'https://rubygems.org' -ruby '3.3.1' - -# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem 'rails', '~> 7.1.3', '>= 7.1.3.4' - # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' diff --git a/test/dummy/Gemfile.lock b/test/dummy/Gemfile.lock index 19178d5..7074df5 100644 --- a/test/dummy/Gemfile.lock +++ b/test/dummy/Gemfile.lock @@ -1,32 +1,6 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.2) actionpack (7.1.3.4) actionview (= 7.1.3.4) activesupport (= 7.1.3.4) @@ -37,34 +11,14 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) actionview (7.1.3.4) activesupport (= 7.1.3.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) - globalid (>= 0.3.6) activemodel (7.1.3.4) activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) - timeout (>= 0.4.0) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) - marcel (~> 1.0) activesupport (7.1.3.4) base64 bigdecimal @@ -96,7 +50,6 @@ GEM concurrent-ruby (1.3.3) connection_pool (2.4.1) crass (1.0.6) - date (3.3.4) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) @@ -109,8 +62,6 @@ GEM railties (>= 5.0.0) faker (3.4.2) i18n (>= 1.8.11, < 2) - globalid (1.2.1) - activesupport (>= 6.1) i18n (1.14.5) concurrent-ruby (~> 1.0) io-console (0.7.2) @@ -126,26 +77,11 @@ GEM loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.8.1) - mini_mime (>= 0.1.1) - net-imap - net-pop - net-smtp - marcel (1.0.4) matrix (0.4.2) mini_mime (1.1.5) minitest (5.24.1) msgpack (1.7.2) mutex_m (0.2.0) - net-imap (0.4.14) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.5.0) - net-protocol nio4r (2.7.3) nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) @@ -173,20 +109,6 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - bundler (>= 1.15.0) - railties (= 7.1.3.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -233,7 +155,6 @@ GEM stringio (3.1.1) strscan (3.1.0) thor (1.3.1) - timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) web-console (4.2.1) @@ -243,9 +164,6 @@ GEM railties (>= 6.0.0) webrick (1.8.1) websocket (1.2.11) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.16) @@ -268,15 +186,11 @@ DEPENDENCIES jbuilder jwt puma (>= 5.0) - rails (~> 7.1.3, >= 7.1.3.4) selenium-webdriver sprockets-rails sqlite3 (~> 1.4) tzinfo-data web-console -RUBY VERSION - ruby 3.3.1p55 - BUNDLED WITH 2.5.15 diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 2ab0d10..314a67a 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -6,6 +6,8 @@ # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) +require "oas_rails" + module Dummy class Application < Rails::Application config.load_defaults Rails::VERSION::STRING.to_f @@ -16,8 +18,16 @@ class Application < Rails::Application # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: %w[assets tasks]) + lib = root.join("lib") + + config.autoload_paths << lib + config.eager_load_paths << lib + Rails.autoloaders.main.ignore( + lib.join("assets"), + lib.join("tasks"), + lib.join("generators") + ) # Configuration for the application, engines, and railties goes here. # # These settings can be overridden in specific environments using the files diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb index 2e7fb48..2248125 100644 --- a/test/dummy/config/environments/development.rb +++ b/test/dummy/config/environments/development.rb @@ -72,5 +72,4 @@ # config.action_cable.disable_request_forgery_protection = true # Raise error when a before_action's only/except options reference missing actions - config.action_controller.raise_on_missing_callback_actions = true end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index adbb4a6..6cc11b4 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -60,5 +60,4 @@ # config.action_view.annotate_rendered_view_with_filenames = true # Raise error when a before_action's only/except options reference missing actions - config.action_controller.raise_on_missing_callback_actions = true end diff --git a/test/dummy/db/migrate/20240712004600_create_users.rb b/test/dummy/db/migrate/20240712004600_create_users.rb index 0903bae..33b1925 100644 --- a/test/dummy/db/migrate/20240712004600_create_users.rb +++ b/test/dummy/db/migrate/20240712004600_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration[7.1] +class CreateUsers < ActiveRecord::Migration[7.0] def change create_table :users do |t| t.string :name diff --git a/test/dummy/db/migrate/20240718211538_create_projects.rb b/test/dummy/db/migrate/20240718211538_create_projects.rb index 2b8ba6c..dc0150e 100644 --- a/test/dummy/db/migrate/20240718211538_create_projects.rb +++ b/test/dummy/db/migrate/20240718211538_create_projects.rb @@ -1,4 +1,4 @@ -class CreateProjects < ActiveRecord::Migration[7.1] +class CreateProjects < ActiveRecord::Migration[7.0] def change create_table :projects do |t| t.string :name diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index fe4db77..f9e83c4 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_07_18_211538) do +ActiveRecord::Schema[7.0].define(version: 2024_07_18_211538) do create_table "projects", force: :cascade do |t| t.string "name" t.text "description"