From 01e1c61863c5d2b993aa906cdc10fe2621c99c26 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 15 Feb 2023 20:05:45 -0600 Subject: [PATCH 01/31] Update to latest rubygems in CI runs --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c807e7ed..73b97737 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler: default bundler-cache: true + rubygems: latest - name: StandardRb check run: bundle exec standardrb - name: Run tests From 944e4991e7529e267da67fbd4389f4a3d0d2d5d1 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 15 Feb 2023 20:41:00 -0600 Subject: [PATCH 02/31] Test against Ruby 3.2 (#305) * Test against Ruby 3.2 * Fix appraisal versions from upgrading themselves * No longer test against Ruby 2.6 * Remove database alias for Rails 6.0 and Ruby 3.1 due to Pysch changes --- .github/workflows/ci.yml | 15 +-- Appraisals | 8 +- Gemfile | 7 ++ acts_as_tenant.gemspec | 7 -- gemfiles/rails_5.gemfile | 8 +- gemfiles/rails_5.gemfile.lock | 59 ++++----- gemfiles/rails_6.gemfile | 8 +- gemfiles/rails_6.gemfile.lock | 200 +++++++++++++++---------------- gemfiles/rails_6_1.gemfile | 8 +- gemfiles/rails_6_1.gemfile.lock | 59 ++++----- gemfiles/rails_7.gemfile | 8 +- gemfiles/rails_7.gemfile.lock | 56 ++++----- gemfiles/rails_main.gemfile | 8 +- gemfiles/rails_main.gemfile.lock | 62 +++++----- gemfiles/sidekiq_7.gemfile | 7 +- gemfiles/sidekiq_7.gemfile.lock | 54 +++++---- spec/dummy/config/database.yml | 6 +- 17 files changed, 306 insertions(+), 274 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73b97737..8e8cabe0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: name: ruby-${{ matrix.ruby }} ${{ matrix.gemfile }} strategy: matrix: - ruby: [ '2.6', '2.7', '3.0', '3.1'] + ruby: ['2.7', '3.0', '3.1', '3.2'] gemfile: - rails_5 - rails_6 @@ -23,17 +23,14 @@ jobs: - rails_main - sidekiq_7 exclude: + - ruby: '3.0' + gemfile: rails_5 - ruby: '3.1' gemfile: rails_5 - - ruby: '3.0' + - ruby: '3.2' gemfile: rails_5 - # Rails 7 requires Ruby 2.7 or higher - - ruby: '2.6' - gemfile: rails_7 - - ruby: '2.6' - gemfile: rails_main - - ruby: '2.6' - gemfile: sidekiq_7 + - ruby: '3.2' + gemfile: rails_6 env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile diff --git a/Appraisals b/Appraisals index 1675c9a7..59884b29 100644 --- a/Appraisals +++ b/Appraisals @@ -1,17 +1,17 @@ appraise "rails-5" do - gem "rails", "~> 5.2", ">= 5.2.6" + gem "rails", "~> 5.2.0", ">= 5.2.6" end appraise "rails-6" do - gem "rails", "~> 6.0", ">= 6.0.4.1" + gem "rails", "~> 6.0.0", ">= 6.0.4.1" end appraise "rails-6-1" do - gem "rails", "~> 6.1", ">= 6.1.4.1" + gem "rails", "~> 6.1.0", ">= 6.1.4.1" end appraise "rails-7" do - gem "rails", "~> 7.0", ">= 7.0.0" + gem "rails", "~> 7.0.0", ">= 7.0.0" end appraise "rails-main" do diff --git a/Gemfile b/Gemfile index 15e69bd1..e3424334 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,13 @@ gemspec # Git. Remember to move these dependencies to your gemspec before releasing # your gem to rubygems.org. +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3", "~> 1.6.0.rc2" +gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "standard" +gem "appraisal" + # To use a debugger gem "byebug", group: [:development, :test] diff --git a/acts_as_tenant.gemspec b/acts_as_tenant.gemspec index 4c9b7f7b..96a686f5 100644 --- a/acts_as_tenant.gemspec +++ b/acts_as_tenant.gemspec @@ -16,11 +16,4 @@ Gem::Specification.new do |spec| spec.add_dependency "request_store", ">= 1.0.5" spec.add_dependency "rails", ">= 5.2" - - spec.add_development_dependency "rspec", ">=3.0" - spec.add_development_dependency "rspec-rails" - spec.add_development_dependency "sqlite3" - spec.add_development_dependency "sidekiq", "~> 6.1", ">= 6.1.2" - spec.add_development_dependency "standard" - spec.add_development_dependency "appraisal" end diff --git a/gemfiles/rails_5.gemfile b/gemfiles/rails_5.gemfile index 5e1e657a..6dac0e39 100644 --- a/gemfiles/rails_5.gemfile +++ b/gemfiles/rails_5.gemfile @@ -2,8 +2,14 @@ source "https://rubygems.org" +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3", "~> 1.6.0.rc2" +gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "standard" +gem "appraisal" gem "byebug", group: [:development, :test] -gem "rails", "~> 5.2", ">= 5.2.6" +gem "rails", "~> 5.2.0", ">= 5.2.6" group :development, :test do gem "net-imap" diff --git a/gemfiles/rails_5.gemfile.lock b/gemfiles/rails_5.gemfile.lock index eb1dc28a..b8554c77 100644 --- a/gemfiles/rails_5.gemfile.lock +++ b/gemfiles/rails_5.gemfile.lock @@ -60,9 +60,9 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) - date (3.3.2) + date (3.3.3) diff-lcs (1.5.0) - erubi (1.11.0) + erubi (1.12.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -72,7 +72,7 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0) + mail (2.8.0.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -80,8 +80,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.16.3) - net-imap (0.3.2) + minitest (5.17.0) + net-imap (0.3.4) date net-protocol net-pop (0.1.2) @@ -91,17 +91,17 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10-arm64-darwin) + nokogiri (1.14.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) - racc (1.6.1) - rack (2.2.4) + racc (1.6.2) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rails (5.2.8.1) @@ -141,10 +141,10 @@ GEM rspec-mocks (~> 3.12.0) rspec-core (3.12.0) rspec-support (~> 3.12.0) - rspec-expectations (3.12.1) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.1) + rspec-mocks (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (5.1.2) @@ -156,19 +156,19 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.12.0) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) @@ -176,26 +176,26 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sprockets (4.1.1) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.5.4-arm64-darwin) - sqlite3 (1.5.4-x86_64-darwin) - sqlite3 (1.5.4-x86_64-linux) - standard (1.19.1) + sqlite3 (1.6.0.rc2-arm64-darwin) + sqlite3 (1.6.0.rc2-x86_64-darwin) + sqlite3 (1.6.0.rc2-x86_64-linux) + standard (1.21.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.39.0) - rubocop-performance (= 1.15.1) + rubocop (= 1.42.0) + rubocop-performance (= 1.15.2) thor (1.2.1) thread_safe (0.3.6) timeout (0.3.1) tzinfo (1.2.10) thread_safe (~> 0.1) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -204,6 +204,7 @@ PLATFORMS arm64-darwin-22 x86_64-darwin-20 x86_64-darwin-21 + x86_64-darwin-22 x86_64-linux DEPENDENCIES @@ -213,12 +214,12 @@ DEPENDENCIES net-imap net-pop net-smtp - rails (~> 5.2, >= 5.2.6) + rails (~> 5.2.0, >= 5.2.6) rspec (>= 3.0) rspec-rails sidekiq (~> 6.1, >= 6.1.2) - sqlite3 + sqlite3 (~> 1.6.0.rc2) standard BUNDLED WITH - 2.3.26 + 2.4.3 diff --git a/gemfiles/rails_6.gemfile b/gemfiles/rails_6.gemfile index 7d63ec3b..103c97d1 100644 --- a/gemfiles/rails_6.gemfile +++ b/gemfiles/rails_6.gemfile @@ -2,8 +2,14 @@ source "https://rubygems.org" +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3", "~> 1.6.0.rc2" +gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "standard" +gem "appraisal" gem "byebug", group: [:development, :test] -gem "rails", "~> 6.0", ">= 6.0.4.1" +gem "rails", "~> 6.0.0", ">= 6.0.4.1" group :development, :test do gem "net-imap" diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 4bb5f6b7..acf07442 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -8,65 +8,61 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + actioncable (6.0.6) + actionpack (= 6.0.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actionmailbox (6.0.6) + actionpack (= 6.0.6) + activejob (= 6.0.6) + activerecord (= 6.0.6) + activestorage (= 6.0.6) + activesupport (= 6.0.6) mail (>= 2.7.1) - actionmailer (6.1.7) - actionpack (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activesupport (= 6.1.7) + actionmailer (6.0.6) + actionpack (= 6.0.6) + actionview (= 6.0.6) + activejob (= 6.0.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7) - actionview (= 6.1.7) - activesupport (= 6.1.7) - rack (~> 2.0, >= 2.0.9) + actionpack (6.0.6) + actionview (= 6.0.6) + activesupport (= 6.0.6) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7) - actionpack (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actiontext (6.0.6) + actionpack (= 6.0.6) + activerecord (= 6.0.6) + activestorage (= 6.0.6) + activesupport (= 6.0.6) nokogiri (>= 1.8.5) - actionview (6.1.7) - activesupport (= 6.1.7) + actionview (6.0.6) + activesupport (= 6.0.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7) - activesupport (= 6.1.7) + activejob (6.0.6) + activesupport (= 6.0.6) globalid (>= 0.3.6) - activemodel (6.1.7) - activesupport (= 6.1.7) - activerecord (6.1.7) - activemodel (= 6.1.7) - activesupport (= 6.1.7) - activestorage (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activesupport (= 6.1.7) + activemodel (6.0.6) + activesupport (= 6.0.6) + activerecord (6.0.6) + activemodel (= 6.0.6) + activesupport (= 6.0.6) + activestorage (6.0.6) + actionpack (= 6.0.6) + activejob (= 6.0.6) + activerecord (= 6.0.6) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (6.1.7) + activesupport (6.0.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) appraisal (2.4.1) bundler rake @@ -77,9 +73,9 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) - date (3.3.2) + date (3.3.3) diff-lcs (1.5.0) - erubi (1.11.0) + erubi (1.12.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -89,7 +85,7 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0) + mail (2.8.0.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -97,8 +93,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.16.3) - net-imap (0.3.2) + minitest (5.17.0) + net-imap (0.3.4) date net-protocol net-pop (0.1.2) @@ -108,45 +104,45 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10-arm64-darwin) + nokogiri (1.14.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) - racc (1.6.1) - rack (2.2.4) + racc (1.6.2) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) - rails (6.1.7) - actioncable (= 6.1.7) - actionmailbox (= 6.1.7) - actionmailer (= 6.1.7) - actionpack (= 6.1.7) - actiontext (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activemodel (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) - bundler (>= 1.15.0) - railties (= 6.1.7) + rails (6.0.6) + actioncable (= 6.0.6) + actionmailbox (= 6.0.6) + actionmailer (= 6.0.6) + actionpack (= 6.0.6) + actiontext (= 6.0.6) + actionview (= 6.0.6) + activejob (= 6.0.6) + activemodel (= 6.0.6) + activerecord (= 6.0.6) + activestorage (= 6.0.6) + activesupport (= 6.0.6) + bundler (>= 1.3.0) + railties (= 6.0.6) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.4) loofah (~> 2.19, >= 2.19.1) - railties (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + railties (6.0.6) + actionpack (= 6.0.6) + activesupport (= 6.0.6) method_source - rake (>= 12.2) - thor (~> 1.0) + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) rainbow (3.1.1) rake (13.0.6) redis (4.8.0) @@ -160,34 +156,34 @@ GEM rspec-mocks (~> 3.12.0) rspec-core (3.12.0) rspec-support (~> 3.12.0) - rspec-expectations (3.12.1) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.1) + rspec-mocks (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.1) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) rspec-support (3.12.0) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) @@ -195,25 +191,26 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sprockets (4.1.1) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.5.4-arm64-darwin) - sqlite3 (1.5.4-x86_64-darwin) - sqlite3 (1.5.4-x86_64-linux) - standard (1.19.1) + sqlite3 (1.6.0.rc2-arm64-darwin) + sqlite3 (1.6.0.rc2-x86_64-darwin) + sqlite3 (1.6.0.rc2-x86_64-linux) + standard (1.21.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.39.0) - rubocop-performance (= 1.15.1) + rubocop (= 1.42.0) + rubocop-performance (= 1.15.2) thor (1.2.1) + thread_safe (0.3.6) timeout (0.3.1) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + tzinfo (1.2.10) + thread_safe (~> 0.1) + unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -223,6 +220,7 @@ PLATFORMS arm64-darwin-22 x86_64-darwin-20 x86_64-darwin-21 + x86_64-darwin-22 x86_64-linux DEPENDENCIES @@ -232,12 +230,12 @@ DEPENDENCIES net-imap net-pop net-smtp - rails (~> 6.0, >= 6.0.4.1) + rails (~> 6.0.0, >= 6.0.4.1) rspec (>= 3.0) rspec-rails sidekiq (~> 6.1, >= 6.1.2) - sqlite3 + sqlite3 (~> 1.6.0.rc2) standard BUNDLED WITH - 2.3.26 + 2.4.3 diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index 94bdb2e8..5f221257 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -2,8 +2,14 @@ source "https://rubygems.org" +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3", "~> 1.6.0.rc2" +gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "standard" +gem "appraisal" gem "byebug", group: [:development, :test] -gem "rails", "~> 6.1", ">= 6.1.4.1" +gem "rails", "~> 6.1.0", ">= 6.1.4.1" group :development, :test do gem "net-imap" diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index 628c265e..5b31a94d 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -77,9 +77,9 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) - date (3.3.2) + date (3.3.3) diff-lcs (1.5.0) - erubi (1.11.0) + erubi (1.12.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -89,7 +89,7 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0) + mail (2.8.0.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -97,8 +97,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.16.3) - net-imap (0.3.2) + minitest (5.17.0) + net-imap (0.3.4) date net-protocol net-pop (0.1.2) @@ -108,17 +108,17 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10-arm64-darwin) + nokogiri (1.14.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) - racc (1.6.1) - rack (2.2.4) + racc (1.6.2) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rails (6.1.7) @@ -160,10 +160,10 @@ GEM rspec-mocks (~> 3.12.0) rspec-core (3.12.0) rspec-support (~> 3.12.0) - rspec-expectations (3.12.1) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.1) + rspec-mocks (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (6.0.1) @@ -175,19 +175,19 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.12.0) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) @@ -195,25 +195,25 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sprockets (4.1.1) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.5.4-arm64-darwin) - sqlite3 (1.5.4-x86_64-darwin) - sqlite3 (1.5.4-x86_64-linux) - standard (1.19.1) + sqlite3 (1.6.0.rc2-arm64-darwin) + sqlite3 (1.6.0.rc2-x86_64-darwin) + sqlite3 (1.6.0.rc2-x86_64-linux) + standard (1.21.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.39.0) - rubocop-performance (= 1.15.1) + rubocop (= 1.42.0) + rubocop-performance (= 1.15.2) thor (1.2.1) timeout (0.3.1) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -223,6 +223,7 @@ PLATFORMS arm64-darwin-22 x86_64-darwin-20 x86_64-darwin-21 + x86_64-darwin-22 x86_64-linux DEPENDENCIES @@ -232,12 +233,12 @@ DEPENDENCIES net-imap net-pop net-smtp - rails (~> 6.1, >= 6.1.4.1) + rails (~> 6.1.0, >= 6.1.4.1) rspec (>= 3.0) rspec-rails sidekiq (~> 6.1, >= 6.1.2) - sqlite3 + sqlite3 (~> 1.6.0.rc2) standard BUNDLED WITH - 2.3.26 + 2.4.3 diff --git a/gemfiles/rails_7.gemfile b/gemfiles/rails_7.gemfile index 6ac185c0..ef624b19 100644 --- a/gemfiles/rails_7.gemfile +++ b/gemfiles/rails_7.gemfile @@ -2,8 +2,14 @@ source "https://rubygems.org" +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3", "~> 1.6.0.rc2" +gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "standard" +gem "appraisal" gem "byebug", group: [:development, :test] -gem "rails", "~> 7.0", ">= 7.0.0" +gem "rails", "~> 7.0.0", ">= 7.0.0" group :development, :test do gem "net-imap" diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index 93e8ce5e..bff4fef7 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -83,9 +83,9 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) - date (3.3.2) + date (3.3.3) diff-lcs (1.5.0) - erubi (1.11.0) + erubi (1.12.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -95,7 +95,7 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0) + mail (2.8.0.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -103,9 +103,9 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.16.3) - net-imap (0.3.2) + mini_portile2 (2.8.1) + minitest (5.17.0) + net-imap (0.3.4) date net-protocol net-pop (0.1.2) @@ -115,18 +115,18 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10) + nokogiri (1.14.0) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) - racc (1.6.1) - rack (2.2.4) + racc (1.6.2) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rails (7.0.4) @@ -168,10 +168,10 @@ GEM rspec-mocks (~> 3.12.0) rspec-core (3.12.0) rspec-support (~> 3.12.0) - rspec-expectations (3.12.1) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.1) + rspec-mocks (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (6.0.1) @@ -183,19 +183,19 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.12.0) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) @@ -203,19 +203,19 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sqlite3 (1.5.4) + sqlite3 (1.6.0.rc2) mini_portile2 (~> 2.8.0) - sqlite3 (1.5.4-x86_64-darwin) - sqlite3 (1.5.4-x86_64-linux) - standard (1.19.1) + sqlite3 (1.6.0.rc2-x86_64-darwin) + sqlite3 (1.6.0.rc2-x86_64-linux) + standard (1.21.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.39.0) - rubocop-performance (= 1.15.1) + rubocop (= 1.42.0) + rubocop-performance (= 1.15.2) thor (1.2.1) timeout (0.3.1) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -233,12 +233,12 @@ DEPENDENCIES net-imap net-pop net-smtp - rails (~> 7.0, >= 7.0.0) + rails (~> 7.0.0, >= 7.0.0) rspec (>= 3.0) rspec-rails sidekiq (~> 6.1, >= 6.1.2) - sqlite3 + sqlite3 (~> 1.6.0.rc2) standard BUNDLED WITH - 2.3.26 + 2.4.3 diff --git a/gemfiles/rails_main.gemfile b/gemfiles/rails_main.gemfile index 5972e1c5..7f2d41d8 100644 --- a/gemfiles/rails_main.gemfile +++ b/gemfiles/rails_main.gemfile @@ -2,14 +2,18 @@ source "https://rubygems.org" +gem "rspec", git: "https://github.com/rspec/rspec.git", branch: "main" +gem "rspec-rails", git: "https://github.com/rspec/rspec-rails.git", branch: "main" +gem "sqlite3", "~> 1.6.0.rc2" +gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "standard" +gem "appraisal" gem "byebug", group: [:development, :test] gem "rails", branch: :main, git: "https://github.com/rails/rails.git" -gem "rspec", git: "https://github.com/rspec/rspec.git", branch: "main" gem "rspec-core", git: "https://github.com/rspec/rspec-core.git", branch: "main" gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations.git", branch: "main" gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks.git", branch: "main" gem "rspec-support", git: "https://github.com/rspec/rspec-support.git", branch: "main" -gem "rspec-rails", git: "https://github.com/rspec/rspec-rails.git", branch: "main" group :development, :test do gem "net-imap" diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index 71b816a0..cbd1c4ff 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: 01001028dfa01e5d038baf1a07758ad7acf2b7a8 + revision: bef58144b6398d34e93b873a8418391270f2c0db branch: main specs: actioncable (7.1.0.alpha) @@ -93,7 +93,7 @@ GIT GIT remote: https://github.com/rspec/rspec-core.git - revision: 522b7727d02d9648c090b56fa68bbdc18a21c04d + revision: 79ec0fd5b5ebd13031a10960f293b8a4a43cb734 branch: main specs: rspec-core (3.13.0.pre) @@ -101,7 +101,7 @@ GIT GIT remote: https://github.com/rspec/rspec-expectations.git - revision: ae06ba1535fca7c0ce4014d7d05fae823e6be9d4 + revision: 4ef5b0e21c2273a14ff46b2382ab921e7b100d72 branch: main specs: rspec-expectations (3.13.0.pre) @@ -110,7 +110,7 @@ GIT GIT remote: https://github.com/rspec/rspec-mocks.git - revision: f4f444c19b89a48855dec106461d440a5b418684 + revision: 44d987e5ee9b09e20a97774eb1f4cf2972048649 branch: main specs: rspec-mocks (3.13.0.pre) @@ -119,7 +119,7 @@ GIT GIT remote: https://github.com/rspec/rspec-rails.git - revision: c60ff7907559653cd9d1ec1a6113bf86c9359fab + revision: 40261bb72875c00a6e4a0ca2ac697b660d4e8d9c branch: main specs: rspec-rails (6.1.0.pre) @@ -133,7 +133,7 @@ GIT GIT remote: https://github.com/rspec/rspec-support.git - revision: e28c64aba9e625d8b153ec010f43b4ecb298b73b + revision: 9b9a81c0b38cd2fc6af69932e12f3eab2cee992a branch: main specs: rspec-support (3.13.0.pre) @@ -168,9 +168,9 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) - date (3.3.2) + date (3.3.3) diff-lcs (1.5.0) - erubi (1.11.0) + erubi (1.12.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -180,16 +180,16 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.8.0) + mail (2.8.0.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp marcel (1.0.2) mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.16.3) - net-imap (0.3.2) + mini_portile2 (2.8.1) + minitest (5.17.0) + net-imap (0.3.4) date net-protocol net-pop (0.1.2) @@ -199,18 +199,18 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10) + nokogiri (1.14.0) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) - racc (1.6.1) - rack (2.2.4) + racc (1.6.2) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rails-dom-testing (2.0.3) @@ -225,19 +225,19 @@ GEM request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) @@ -245,19 +245,19 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sqlite3 (1.5.4) + sqlite3 (1.6.0.rc2) mini_portile2 (~> 2.8.0) - sqlite3 (1.5.4-x86_64-darwin) - sqlite3 (1.5.4-x86_64-linux) - standard (1.19.1) + sqlite3 (1.6.0.rc2-x86_64-darwin) + sqlite3 (1.6.0.rc2-x86_64-linux) + standard (1.21.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.39.0) - rubocop-performance (= 1.15.1) + rubocop (= 1.42.0) + rubocop-performance (= 1.15.2) thor (1.2.1) timeout (0.3.1) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -283,8 +283,8 @@ DEPENDENCIES rspec-rails! rspec-support! sidekiq (~> 6.1, >= 6.1.2) - sqlite3 + sqlite3 (~> 1.6.0.rc2) standard BUNDLED WITH - 2.3.26 + 2.4.3 diff --git a/gemfiles/sidekiq_7.gemfile b/gemfiles/sidekiq_7.gemfile index f6d8448d..6bf50919 100644 --- a/gemfiles/sidekiq_7.gemfile +++ b/gemfiles/sidekiq_7.gemfile @@ -2,8 +2,13 @@ source "https://rubygems.org" -gem "byebug", group: [:development, :test] +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3", "~> 1.6.0.rc2" gem "sidekiq", "~> 7.0" +gem "standard" +gem "appraisal" +gem "byebug", group: [:development, :test] group :development, :test do gem "net-imap" diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock index ff7d1723..b2fbce33 100644 --- a/gemfiles/sidekiq_7.gemfile.lock +++ b/gemfiles/sidekiq_7.gemfile.lock @@ -83,10 +83,10 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.3.0) crass (1.0.6) - date (3.3.2) + date (3.3.3) diff-lcs (1.5.0) - erubi (1.11.0) - globalid (1.0.1) + erubi (1.12.0) + globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) concurrent-ruby (~> 1.0) @@ -103,8 +103,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.16.3) - net-imap (0.3.2) + minitest (5.17.0) + net-imap (0.3.4) date net-protocol net-pop (0.1.2) @@ -114,15 +114,17 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10-arm64-darwin) + nokogiri (1.14.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) - racc (1.6.1) - rack (2.2.4) + racc (1.6.2) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rails (7.0.4) @@ -153,7 +155,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - redis-client (0.11.2) + redis-client (0.12.0) connection_pool regexp_parser (2.6.1) request_store (1.5.1) @@ -165,10 +167,10 @@ GEM rspec-mocks (~> 3.12.0) rspec-core (3.12.0) rspec-support (~> 3.12.0) - rspec-expectations (3.12.1) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.1) + rspec-mocks (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (6.0.1) @@ -180,38 +182,39 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.12.0) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.11.0) - sidekiq (7.0.2) + sidekiq (7.0.3) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.11.0) - sqlite3 (1.5.4-arm64-darwin) - sqlite3 (1.5.4-x86_64-linux) - standard (1.19.1) + sqlite3 (1.6.0.rc2-arm64-darwin) + sqlite3 (1.6.0.rc2-x86_64-darwin) + sqlite3 (1.6.0.rc2-x86_64-linux) + standard (1.21.1) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.39.0) - rubocop-performance (= 1.15.1) + rubocop (= 1.42.0) + rubocop-performance (= 1.15.2) thor (1.2.1) timeout (0.3.1) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -219,6 +222,7 @@ GEM PLATFORMS arm64-darwin-22 + x86_64-darwin-22 x86_64-linux DEPENDENCIES @@ -231,7 +235,7 @@ DEPENDENCIES rspec (>= 3.0) rspec-rails sidekiq (~> 7.0) - sqlite3 + sqlite3 (~> 1.6.0.rc2) standard BUNDLED WITH diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml index 95b19bc1..6069432a 100644 --- a/spec/dummy/config/database.yml +++ b/spec/dummy/config/database.yml @@ -4,16 +4,14 @@ # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' # -default: &default - adapter: sqlite3 development: - <<: *default + adapter: sqlite3 database: db/acts_as_tenant_dev.sqlite3 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - <<: *default + adapter: sqlite3 database: db/acts_as_tenant_test.sqlite3 From 5542e7b447fe8da3d9157432e6b14e8544fbcb04 Mon Sep 17 00:00:00 2001 From: Adrian Gomez Date: Fri, 6 May 2022 09:44:10 -0300 Subject: [PATCH 03/31] Honor the scope passed to associations when performing validations Also, allow to pass a scope to acts_as_tenant --- lib/acts_as_tenant/model_extensions.rb | 7 ++++--- spec/dummy/app/models/account.rb | 2 ++ spec/dummy/app/models/manager.rb | 4 ++-- spec/dummy/app/models/project.rb | 2 ++ spec/dummy/db/schema.rb | 2 ++ spec/models/model_extensions_spec.rb | 15 +++++++++++++++ 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/acts_as_tenant/model_extensions.rb b/lib/acts_as_tenant/model_extensions.rb index 5bd113ae..962ff412 100644 --- a/lib/acts_as_tenant/model_extensions.rb +++ b/lib/acts_as_tenant/model_extensions.rb @@ -3,7 +3,7 @@ module ModelExtensions extend ActiveSupport::Concern class_methods do - def acts_as_tenant(tenant = :account, **options) + def acts_as_tenant(tenant = :account, scope = nil, **options) ActsAsTenant.set_tenant_klass(tenant) ActsAsTenant.mutable_tenant!(false) @@ -14,7 +14,7 @@ def acts_as_tenant(tenant = :account, **options) fkey = valid_options[:foreign_key] || ActsAsTenant.fkey pkey = valid_options[:primary_key] || ActsAsTenant.pkey polymorphic_type = valid_options[:foreign_type] || ActsAsTenant.polymorphic_type - belongs_to tenant, **valid_options + belongs_to tenant, scope, **valid_options default_scope lambda { if ActsAsTenant.should_require_tenant? && ActsAsTenant.current_tenant.nil? && !ActsAsTenant.unscoped? @@ -66,7 +66,8 @@ def acts_as_tenant(tenant = :account, **options) else a.primary_key end.to_sym - record.errors.add attr, "association is invalid [ActsAsTenant]" unless value.nil? || a.klass.where(primary_key => value).any? + scope = a.scope || ->(relation) { relation } + record.errors.add attr, "association is invalid [ActsAsTenant]" unless value.nil? || a.klass.class_eval(&scope).where(primary_key => value).any? end end end diff --git a/spec/dummy/app/models/account.rb b/spec/dummy/app/models/account.rb index 6e11e19c..77f4ce43 100644 --- a/spec/dummy/app/models/account.rb +++ b/spec/dummy/app/models/account.rb @@ -3,4 +3,6 @@ class Account < ActiveRecord::Base has_many :global_projects has_many :users_accounts has_many :users, through: :users_accounts + + default_scope -> { where(deleted_at: nil) } end diff --git a/spec/dummy/app/models/manager.rb b/spec/dummy/app/models/manager.rb index ea794f60..3049e444 100644 --- a/spec/dummy/app/models/manager.rb +++ b/spec/dummy/app/models/manager.rb @@ -1,4 +1,4 @@ class Manager < ActiveRecord::Base - belongs_to :project - acts_as_tenant :account + belongs_to :project, -> { unscope(where: :deleted_at) } + acts_as_tenant :account, -> { unscope(where: :deleted_at) } end diff --git a/spec/dummy/app/models/project.rb b/spec/dummy/app/models/project.rb index 39084ef5..3fa01bde 100644 --- a/spec/dummy/app/models/project.rb +++ b/spec/dummy/app/models/project.rb @@ -5,4 +5,6 @@ class Project < ActiveRecord::Base acts_as_tenant :account validates_uniqueness_to_tenant :name + + default_scope -> { where(deleted_at: nil) } end diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index d17a4b94..3ba91821 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -15,6 +15,7 @@ t.column :name, :string t.column :subdomain, :string t.column :domain, :string + t.column :deleted_at, :timestamp t.column :projects_count, :integer, default: 0 end @@ -22,6 +23,7 @@ t.column :name, :string t.column :account_id, :integer t.column :user_defined_scope, :string + t.column :deleted_at, :timestamp end create_table :managers, force: true do |t| diff --git a/spec/models/model_extensions_spec.rb b/spec/models/model_extensions_spec.rb index 613a9f71..ec1a92a9 100644 --- a/spec/models/model_extensions_spec.rb +++ b/spec/models/model_extensions_spec.rb @@ -242,6 +242,21 @@ expect(AliasedTask.create(name: "foo", project_alias: @project2).valid?).to eq(true) end + it "uses the scope passed to acts_as_tenant" do + account.update!(deleted_at: Time.now) + manager = Manager.create!(account_id: account.id) + + expect(manager.valid?).to eq(true) + expect(manager.account).to eq(account) + end + + it "uses the scope passed to belongs_to when validating" do + project = account.projects.create!(name: "foobar", deleted_at: Time.now) + manager = Manager.new(account: account, project: project) + + expect(manager.valid?).to eq(true) + end + describe "It should be possible to use associations with foreign_key from polymorphic" do it "tenanted objects have a polymorphic association" do ActsAsTenant.current_tenant = account From efb05b26187e9a00bf9a386bc491ea8115d803f9 Mon Sep 17 00:00:00 2001 From: Santiago Herrero Date: Fri, 20 May 2022 15:42:19 -0300 Subject: [PATCH 04/31] Ignore tenant scope when finding tenant on sidekiq --- lib/acts_as_tenant/sidekiq.rb | 2 +- spec/acts_as_tenant/sidekiq_spec.rb | 37 +++++++++++++++++++---------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/acts_as_tenant/sidekiq.rb b/lib/acts_as_tenant/sidekiq.rb index 8c9b1838..c30a9227 100644 --- a/lib/acts_as_tenant/sidekiq.rb +++ b/lib/acts_as_tenant/sidekiq.rb @@ -28,7 +28,7 @@ class Server < BaseMiddleware def call(worker_class, msg, queue) if msg.has_key?("acts_as_tenant") - account = msg["acts_as_tenant"]["class"].constantize.find msg["acts_as_tenant"]["id"] + account = msg["acts_as_tenant"]["class"].constantize.unscoped.find msg["acts_as_tenant"]["id"] ActsAsTenant.with_tenant account do yield end diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index 1fa29209..030e140d 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -29,24 +29,37 @@ describe ActsAsTenant::Sidekiq::Server do subject { ActsAsTenant::Sidekiq::Server.new } - it "restores tenant if tenant saved" do - expect(Account).to receive(:find).with(1234).once { account } + context "when tenant exist" do + before { account.save } - msg = message - subject.call(nil, msg, nil) do - expect(ActsAsTenant.current_tenant).to be_a_kind_of Account + it "restores tenant" do + msg = message + subject.call(nil, msg, nil) do + expect(ActsAsTenant.current_tenant).to be_a_kind_of Account + end + expect(ActsAsTenant.current_tenant).to be_nil end - expect(ActsAsTenant.current_tenant).to be_nil - end - it "runs without tenant if no tenant saved" do - expect(Account).not_to receive(:find) + context "but it is outside its own scope" do + before { account.update!(deleted_at: Time.now) } - msg = {} - subject.call(nil, msg, nil) do + it "ignores the scope and sets the tenant" do + msg = {} + subject.call(nil, message, nil) do + expect(ActsAsTenant.current_tenant).to eq(account) + end + end + end + end + + context "when tenant does not exist" do + it "runs without tenant" do + msg = {} + subject.call(nil, msg, nil) do + expect(ActsAsTenant.current_tenant).to be_nil + end expect(ActsAsTenant.current_tenant).to be_nil end - expect(ActsAsTenant.current_tenant).to be_nil end end From d8ec2547f05e0da9e76184174d40fb3013ea1a03 Mon Sep 17 00:00:00 2001 From: adrian-gomez Date: Wed, 3 Aug 2022 13:20:38 -0300 Subject: [PATCH 05/31] Only validate associations if those are changing --- lib/acts_as_tenant/model_extensions.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/acts_as_tenant/model_extensions.rb b/lib/acts_as_tenant/model_extensions.rb index 962ff412..053b9b85 100644 --- a/lib/acts_as_tenant/model_extensions.rb +++ b/lib/acts_as_tenant/model_extensions.rb @@ -61,13 +61,16 @@ def acts_as_tenant(tenant = :account, scope = nil, **options) reflect_on_all_associations(:belongs_to).each do |a| unless a == reflect_on_association(tenant) || polymorphic_foreign_keys.include?(a.foreign_key) validates_each a.foreign_key.to_sym do |record, attr, value| + next if value.nil? + next unless record.will_save_change_to_attribute?(attr) + primary_key = if a.respond_to?(:active_record_primary_key) a.active_record_primary_key else a.primary_key end.to_sym scope = a.scope || ->(relation) { relation } - record.errors.add attr, "association is invalid [ActsAsTenant]" unless value.nil? || a.klass.class_eval(&scope).where(primary_key => value).any? + record.errors.add attr, "association is invalid [ActsAsTenant]" unless a.klass.class_eval(&scope).where(primary_key => value).any? end end end From 1e2c820703f2251a9744ade0dc7020bfbf6327c9 Mon Sep 17 00:00:00 2001 From: Nuno Costa Date: Tue, 13 Jun 2023 23:31:48 +0100 Subject: [PATCH 06/31] not to run sidekiq_spec unless sidekiq is installed --- spec/acts_as_tenant/sidekiq_spec.rb | 9 ++++----- spec/spec_helper.rb | 5 +++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index 1fa29209..9adc19d0 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -1,12 +1,11 @@ require "spec_helper" -require "sidekiq" -require "acts_as_tenant/sidekiq" +require "acts_as_tenant/sidekiq" if defined?(Sidekiq) -describe ActsAsTenant::Sidekiq do +describe "ActsAsTenant::Sidekiq", sidekiq: true do let(:account) { Account.new(id: 1234) } let(:message) { {"acts_as_tenant" => {"class" => "Account", "id" => 1234}} } - describe ActsAsTenant::Sidekiq::Client do + describe "ActsAsTenant::Sidekiq::Client" do subject { ActsAsTenant::Sidekiq::Client.new } it "saves tenant if present" do @@ -26,7 +25,7 @@ end end - describe ActsAsTenant::Sidekiq::Server do + describe "ActsAsTenant::Sidekiq::Server" do subject { ActsAsTenant::Sidekiq::Server.new } it "restores tenant if tenant saved" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 03c27e3d..b5bf01e0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,4 +17,9 @@ config.global_fixtures = :all config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = true + config.filter_run_when_matching :focus + + unless defined?(Sidekiq) + config.filter_run_excluding sidekiq: true + end end From 5c0599bfc7ee5439ecdbb4bf017d238dadbff1a5 Mon Sep 17 00:00:00 2001 From: Nuno Costa Date: Tue, 13 Jun 2023 23:39:08 +0100 Subject: [PATCH 07/31] self pulls Sidekiq middleware if the gem has been loaded --- CHANGELOG.md | 2 ++ README.md | 42 ++++++++++++++++------------- lib/acts_as_tenant.rb | 1 + spec/acts_as_tenant/sidekiq_spec.rb | 1 - 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d94e56..4b6be369 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ Unreleased ---------- +* Easy integration with Sidekiq, not requiring to add any configuration to the initializer - @nunommc + 0.6.1 ----- diff --git a/README.md b/README.md index 72108213..279dbe57 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Want to see how it works? Check out [the ActsAsTenant walkthrough video](https:/ Installation ------------ + acts_as_tenant will only work on Rails 5.2 and up. This is due to changes made to the handling of `default_scope`, an essential pillar of the gem. To use it, add it to your Gemfile: @@ -45,6 +46,7 @@ gem 'acts_as_tenant' Getting started =============== + There are two steps in adding multi-tenancy to your app with acts_as_tenant: 1. setting the current tenant and @@ -52,6 +54,7 @@ There are two steps in adding multi-tenancy to your app with acts_as_tenant: Setting the current tenant -------------------------- + There are three ways to set the current tenant: 1. by using the subdomain to lookup the current tenant, @@ -59,6 +62,7 @@ There are three ways to set the current tenant: 3. by setting the current tenant for a block. ### Looking Up Tenants + #### By Subdomain to lookup the current tenant ```ruby @@ -115,7 +119,7 @@ end This allows the tenant to be set before any other code runs so everything is within the current tenant. -### Setting the current tenant for a block ### +### Setting the current tenant for a block ```ruby ActsAsTenant.with_tenant(current_account) do @@ -128,16 +132,17 @@ any code in this block will be scoped to the current tenant. All methods that se **Note:** If the current tenant is not set by one of these methods, Acts_as_tenant will be unable to apply the proper scope to your models. So make sure you use one of the two methods to tell acts_as_tenant about the current tenant. -### Disabling tenant checking for a block ### +### Disabling tenant checking for a block ```ruby ActsAsTenant.without_tenant do # Tenant checking is disabled for all code in this block end ``` + This is useful in shared routes such as admin panels or internal dashboards when `require_tenant` option is enabled throughout the app. -### Allowing tenant updating for a block ### +### Allowing tenant updating for a block ```ruby ActsAsTenant.with_mutable_tenant do @@ -147,7 +152,7 @@ end This will allow you to change the tenant of a model. This feature is useful for admin screens, where it is ok to allow certain users to change the tenant on existing models in specific cases. -### Require tenant to be set always ### +### Require tenant to be set always If you want to require the tenant to be set at all times, you can configure acts_as_tenant to raise an error when a query is made without a tenant available. See below under configuration options. @@ -194,7 +199,7 @@ Project.tasks.all # => all tasks with account_id => 3 Acts_as_tenant uses Rails' `default_scope` method to scope models. Rails 3.1 changed the way `default_scope` works in a good way. A user defined `default_scope` should integrate seamlessly with the one added by `acts_as_tenant`. -### Validating attribute uniqueness ### +### Validating attribute uniqueness If you need to validate for uniqueness, chances are that you want to scope this validation to a tenant. You can do so by using: @@ -204,7 +209,7 @@ validates_uniqueness_to_tenant :name, :email All options available to Rails' own `validates_uniqueness_of` are also available to this method. -### Custom foreign_key ### +### Custom foreign_key You can explicitly specifiy a foreign_key for AaT to use should the key differ from the default: @@ -212,7 +217,7 @@ You can explicitly specifiy a foreign_key for AaT to use should the key differ f acts_as_tenant(:account, :foreign_key => 'accountID') # by default AaT expects account_id ``` -### Custom primary_key ### +### Custom primary_key You can also explicitly specifiy a primary_key for AaT to use should the key differ from the default: @@ -220,8 +225,7 @@ You can also explicitly specifiy a primary_key for AaT to use should the key dif acts_as_tenant(:account, :primary_key => 'primaryID') # by default AaT expects id ``` - -### Has and belongs to many ### +### Has and belongs to many You can scope a model that is part of a HABTM relationship by using the `through` option. @@ -244,6 +248,7 @@ end Configuration options --------------------- + An initializer can be created to control (currently one) option in ActsAsTenant. Defaults are shown below with sample overrides following. In `config/initializers/acts_as_tenant.rb`: @@ -270,7 +275,8 @@ end `ActsAsTenant.should_require_tenant?` is used to determine if a tenant is required in the current context, either by evaluating the lambda provided, or by returning the boolean value assigned to `config.require_tenant`. belongs_to options ---------------------- +------------------ + `acts_as_tenant :account` includes the belongs_to relationship. So when using acts_as_tenant on a model, do not add `belongs_to :account` alongside `acts_as_tenant :account`: @@ -286,15 +292,12 @@ You can add the following `belongs_to` options to `acts_as_tenant`: Example: `acts_as_tenant(:account, counter_cache: true)` -Sidekiq support ---------------- +Background Processing libraries +------------------------------- -ActsAsTenant supports [Sidekiq](http://sidekiq.org/). A background processing library. -Add the following code to your `config/initializers/acts_as_tenant.rb`: +ActsAsTenant supports -```ruby -require 'acts_as_tenant/sidekiq' -``` +- [Sidekiq](//sidekiq.org/) - make sure to place acts_as_tenant gem after sidekiq in your gemfiles; Testing --------------- @@ -311,7 +314,6 @@ Rails.application.configure do config.middleware.use ActsAsTenant::TestTenantMiddleware end ``` - ```ruby # spec_helper.rb config.before(:suite) do |example| @@ -335,9 +337,9 @@ config.after(:each) do |example| ActsAsTenant.test_tenant = nil end ``` - Bug reports & suggested improvements ------------------------------------ + If you have found a bug or want to suggest an improvement, please use our issue tracked at: [github.com/ErwinM/acts_as_tenant/issues](http://github.com/ErwinM/acts_as_tenant/issues) @@ -357,10 +359,12 @@ We use the Appraisal gem to run tests against supported versions of Rails to tes Author & Credits ---------------- + acts_as_tenant is written by Erwin Matthijssen & Chris Oliver. This gem was inspired by Ryan Sonnek's [Multitenant](https://github.com/wireframe/multitenant) gem and its use of default_scope. License ------- + Copyright (c) 2011 Erwin Matthijssen, released under the MIT license diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index 11180a4b..7e5765fd 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -2,6 +2,7 @@ require "acts_as_tenant/version" require "acts_as_tenant/errors" +require "acts_as_tenant/sidekiq" if defined?(Sidekiq) module ActsAsTenant autoload :Configuration, "acts_as_tenant/configuration" diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index 9adc19d0..aa59d6ae 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -1,5 +1,4 @@ require "spec_helper" -require "acts_as_tenant/sidekiq" if defined?(Sidekiq) describe "ActsAsTenant::Sidekiq", sidekiq: true do let(:account) { Account.new(id: 1234) } From 7fce32fed8d87f9311c635e935065181cef33c9c Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 15 Jun 2023 17:02:58 -0500 Subject: [PATCH 08/31] Refactor test dependencies (#315) * Move Sidekiq 6 to its own appraisal * Always test against the latest version of Sidekiq (7 currently) * Remove Sidekiq 7 appraisal since it's the default --- .github/workflows/ci.yml | 2 +- Appraisals | 4 +- Gemfile | 13 +- gemfiles/rails_5.gemfile | 12 +- gemfiles/rails_5.gemfile.lock | 128 +++++---- gemfiles/rails_6.gemfile | 12 +- gemfiles/rails_6.gemfile.lock | 230 ++++++++-------- gemfiles/rails_6_1.gemfile | 12 +- gemfiles/rails_6_1.gemfile.lock | 246 +++++++++-------- gemfiles/rails_7.gemfile | 12 +- gemfiles/rails_7.gemfile.lock | 252 +++++++++--------- gemfiles/rails_main.gemfile | 12 +- gemfiles/rails_main.gemfile.lock | 164 +++++++----- .../{sidekiq_7.gemfile => sidekiq_6.gemfile} | 12 +- gemfiles/sidekiq_6.gemfile.lock | 252 ++++++++++++++++++ gemfiles/sidekiq_7.gemfile.lock | 242 ----------------- spec/acts_as_tenant/sidekiq_spec.rb | 1 - 17 files changed, 828 insertions(+), 778 deletions(-) rename gemfiles/{sidekiq_7.gemfile => sidekiq_6.gemfile} (55%) create mode 100644 gemfiles/sidekiq_6.gemfile.lock delete mode 100644 gemfiles/sidekiq_7.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e8cabe0..85c2c1e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - rails_6_1 - rails_7 - rails_main - - sidekiq_7 + - sidekiq_6 exclude: - ruby: '3.0' gemfile: rails_5 diff --git a/Appraisals b/Appraisals index 59884b29..a272c2ce 100644 --- a/Appraisals +++ b/Appraisals @@ -21,6 +21,6 @@ appraise "rails-main" do end end -appraise "sidekiq-7" do - gem "sidekiq", "~> 7.0" +appraise "sidekiq-6" do + gem "sidekiq", "~> 6.0" end diff --git a/Gemfile b/Gemfile index e3424334..cb539225 100644 --- a/Gemfile +++ b/Gemfile @@ -13,17 +13,10 @@ gemspec gem "rspec", ">=3.0" gem "rspec-rails" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 7.0" +gem "appraisal", github: "thoughtbot/appraisal" # To use a debugger gem "byebug", group: [:development, :test] - -# Ruby 3.1+ no longer includes these by default -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end diff --git a/gemfiles/rails_5.gemfile b/gemfiles/rails_5.gemfile index 6dac0e39..931d27db 100644 --- a/gemfiles/rails_5.gemfile +++ b/gemfiles/rails_5.gemfile @@ -4,17 +4,11 @@ source "https://rubygems.org" gem "rspec", ">=3.0" gem "rspec-rails" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] gem "rails", "~> 5.2.0", ">= 5.2.6" -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end - gemspec path: "../" diff --git a/gemfiles/rails_5.gemfile.lock b/gemfiles/rails_5.gemfile.lock index b8554c77..75fe9c9d 100644 --- a/gemfiles/rails_5.gemfile.lock +++ b/gemfiles/rails_5.gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: b200e636903700098bef25f4f51dbc4c46e4c04c + specs: + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + PATH remote: .. specs: @@ -49,30 +58,27 @@ GEM i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - appraisal (2.4.1) - bundler - rake - thor (>= 0.14.0) arel (9.0.0) ast (2.4.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) date (3.3.3) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.0.0) + globalid (1.1.0) activesupport (>= 5.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.6.3) - language_server-protocol (3.17.0.2) - loofah (2.19.1) + language_server-protocol (3.17.0.3) + lint_roller (1.0.0) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -80,8 +86,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.17.0) - net-imap (0.3.4) + minitest (5.18.0) + net-imap (0.3.6) date net-protocol net-pop (0.1.2) @@ -90,19 +96,20 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0-arm64-darwin) + nio4r (2.5.9) + nokogiri (1.15.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) + nokogiri (1.15.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.15.2-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) + racc + racc (1.7.1) + rack (2.2.7) + rack-test (2.1.0) rack (>= 1.3) rails (5.2.8.1) actioncable (= 5.2.8.1) @@ -120,8 +127,9 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) railties (5.2.8.1) actionpack (= 5.2.8.1) activesupport (= 5.2.8.1) @@ -130,8 +138,9 @@ GEM thor (>= 0.19.0, < 2.0) rainbow (3.1.1) rake (13.0.6) - redis (4.8.0) - regexp_parser (2.6.1) + redis-client (0.14.1) + connection_pool + regexp_parser (2.8.1) request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) @@ -139,12 +148,12 @@ GEM rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.2) + rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (5.1.2) @@ -156,26 +165,27 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.12.0) - rubocop (1.42.0) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.18.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - sidekiq (6.5.8) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) + ruby-progressbar (1.13.0) + sidekiq (7.1.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) sprockets (4.2.0) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -183,17 +193,24 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.0.rc2-arm64-darwin) - sqlite3 (1.6.0.rc2-x86_64-darwin) - sqlite3 (1.6.0.rc2-x86_64-linux) - standard (1.21.1) + sqlite3 (1.6.3-arm64-darwin) + sqlite3 (1.6.3-x86_64-darwin) + sqlite3 (1.6.3-x86_64-linux) + standard (1.29.0) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) - thor (1.2.1) + lint_roller (~> 1.0) + rubocop (~> 1.52.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.1.0) + standard-custom (1.0.1) + lint_roller (~> 1.0) + standard-performance (1.1.0) + lint_roller (~> 1.0) + rubocop-performance (~> 1.18.0) + thor (1.2.2) thread_safe (0.3.6) - timeout (0.3.1) - tzinfo (1.2.10) + timeout (0.3.2) + tzinfo (1.2.11) thread_safe (~> 0.1) unicode-display_width (2.4.2) websocket-driver (0.7.5) @@ -209,16 +226,13 @@ PLATFORMS DEPENDENCIES acts_as_tenant! - appraisal + appraisal! byebug - net-imap - net-pop - net-smtp rails (~> 5.2.0, >= 5.2.6) rspec (>= 3.0) rspec-rails - sidekiq (~> 6.1, >= 6.1.2) - sqlite3 (~> 1.6.0.rc2) + sidekiq (~> 7.0) + sqlite3 standard BUNDLED WITH diff --git a/gemfiles/rails_6.gemfile b/gemfiles/rails_6.gemfile index 103c97d1..991ccd7f 100644 --- a/gemfiles/rails_6.gemfile +++ b/gemfiles/rails_6.gemfile @@ -4,17 +4,11 @@ source "https://rubygems.org" gem "rspec", ">=3.0" gem "rspec-rails" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] gem "rails", "~> 6.0.0", ">= 6.0.4.1" -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end - gemspec path: "../" diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index acf07442..813516fb 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: b200e636903700098bef25f4f51dbc4c46e4c04c + specs: + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + PATH remote: .. specs: @@ -8,84 +17,81 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.0.6) - actionpack (= 6.0.6) + actioncable (6.0.6.1) + actionpack (= 6.0.6.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.6) - actionpack (= 6.0.6) - activejob (= 6.0.6) - activerecord (= 6.0.6) - activestorage (= 6.0.6) - activesupport (= 6.0.6) + actionmailbox (6.0.6.1) + actionpack (= 6.0.6.1) + activejob (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) mail (>= 2.7.1) - actionmailer (6.0.6) - actionpack (= 6.0.6) - actionview (= 6.0.6) - activejob (= 6.0.6) + actionmailer (6.0.6.1) + actionpack (= 6.0.6.1) + actionview (= 6.0.6.1) + activejob (= 6.0.6.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.6) - actionview (= 6.0.6) - activesupport (= 6.0.6) + actionpack (6.0.6.1) + actionview (= 6.0.6.1) + activesupport (= 6.0.6.1) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.6) - actionpack (= 6.0.6) - activerecord (= 6.0.6) - activestorage (= 6.0.6) - activesupport (= 6.0.6) + actiontext (6.0.6.1) + actionpack (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) nokogiri (>= 1.8.5) - actionview (6.0.6) - activesupport (= 6.0.6) + actionview (6.0.6.1) + activesupport (= 6.0.6.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.6) - activesupport (= 6.0.6) + activejob (6.0.6.1) + activesupport (= 6.0.6.1) globalid (>= 0.3.6) - activemodel (6.0.6) - activesupport (= 6.0.6) - activerecord (6.0.6) - activemodel (= 6.0.6) - activesupport (= 6.0.6) - activestorage (6.0.6) - actionpack (= 6.0.6) - activejob (= 6.0.6) - activerecord (= 6.0.6) + activemodel (6.0.6.1) + activesupport (= 6.0.6.1) + activerecord (6.0.6.1) + activemodel (= 6.0.6.1) + activesupport (= 6.0.6.1) + activestorage (6.0.6.1) + actionpack (= 6.0.6.1) + activejob (= 6.0.6.1) + activerecord (= 6.0.6.1) marcel (~> 1.0) - activesupport (6.0.6) + activesupport (6.0.6.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - appraisal (2.4.1) - bundler - rake - thor (>= 0.14.0) ast (2.4.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) date (3.3.3) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.0.0) + globalid (1.1.0) activesupport (>= 5.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.6.3) - language_server-protocol (3.17.0.2) - loofah (2.19.1) + language_server-protocol (3.17.0.3) + lint_roller (1.0.0) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -93,8 +99,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.17.0) - net-imap (0.3.4) + minitest (5.18.0) + net-imap (0.3.6) date net-protocol net-pop (0.1.2) @@ -103,50 +109,53 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0-arm64-darwin) + nio4r (2.5.9) + nokogiri (1.15.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) + nokogiri (1.15.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.15.2-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) + racc + racc (1.7.1) + rack (2.2.7) + rack-test (2.1.0) rack (>= 1.3) - rails (6.0.6) - actioncable (= 6.0.6) - actionmailbox (= 6.0.6) - actionmailer (= 6.0.6) - actionpack (= 6.0.6) - actiontext (= 6.0.6) - actionview (= 6.0.6) - activejob (= 6.0.6) - activemodel (= 6.0.6) - activerecord (= 6.0.6) - activestorage (= 6.0.6) - activesupport (= 6.0.6) + rails (6.0.6.1) + actioncable (= 6.0.6.1) + actionmailbox (= 6.0.6.1) + actionmailer (= 6.0.6.1) + actionpack (= 6.0.6.1) + actiontext (= 6.0.6.1) + actionview (= 6.0.6.1) + activejob (= 6.0.6.1) + activemodel (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) bundler (>= 1.3.0) - railties (= 6.0.6) + railties (= 6.0.6.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (6.0.6) - actionpack (= 6.0.6) - activesupport (= 6.0.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.0.6.1) + actionpack (= 6.0.6.1) + activesupport (= 6.0.6.1) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rainbow (3.1.1) rake (13.0.6) - redis (4.8.0) - regexp_parser (2.6.1) + redis-client (0.14.1) + connection_pool + regexp_parser (2.8.1) request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) @@ -154,12 +163,12 @@ GEM rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.2) + rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (5.1.2) @@ -171,26 +180,27 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.12.0) - rubocop (1.42.0) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.18.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - sidekiq (6.5.8) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) + ruby-progressbar (1.13.0) + sidekiq (7.1.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) sprockets (4.2.0) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -198,23 +208,30 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.0.rc2-arm64-darwin) - sqlite3 (1.6.0.rc2-x86_64-darwin) - sqlite3 (1.6.0.rc2-x86_64-linux) - standard (1.21.1) + sqlite3 (1.6.3-arm64-darwin) + sqlite3 (1.6.3-x86_64-darwin) + sqlite3 (1.6.3-x86_64-linux) + standard (1.29.0) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) - thor (1.2.1) + lint_roller (~> 1.0) + rubocop (~> 1.52.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.1.0) + standard-custom (1.0.1) + lint_roller (~> 1.0) + standard-performance (1.1.0) + lint_roller (~> 1.0) + rubocop-performance (~> 1.18.0) + thor (1.2.2) thread_safe (0.3.6) - timeout (0.3.1) - tzinfo (1.2.10) + timeout (0.3.2) + tzinfo (1.2.11) thread_safe (~> 0.1) unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.6) + zeitwerk (2.6.8) PLATFORMS arm64-darwin-22 @@ -225,16 +242,13 @@ PLATFORMS DEPENDENCIES acts_as_tenant! - appraisal + appraisal! byebug - net-imap - net-pop - net-smtp rails (~> 6.0.0, >= 6.0.4.1) rspec (>= 3.0) rspec-rails - sidekiq (~> 6.1, >= 6.1.2) - sqlite3 (~> 1.6.0.rc2) + sidekiq (~> 7.0) + sqlite3 standard BUNDLED WITH diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index 5f221257..3ef140f3 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -4,17 +4,11 @@ source "https://rubygems.org" gem "rspec", ">=3.0" gem "rspec-rails" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] gem "rails", "~> 6.1.0", ">= 6.1.4.1" -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end - gemspec path: "../" diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index 5b31a94d..c229e2a9 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: b200e636903700098bef25f4f51dbc4c46e4c04c + specs: + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + PATH remote: .. specs: @@ -8,88 +17,85 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + actioncable (6.1.7.3) + actionpack (= 6.1.7.3) + activesupport (= 6.1.7.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actionmailbox (6.1.7.3) + actionpack (= 6.1.7.3) + activejob (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) mail (>= 2.7.1) - actionmailer (6.1.7) - actionpack (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activesupport (= 6.1.7) + actionmailer (6.1.7.3) + actionpack (= 6.1.7.3) + actionview (= 6.1.7.3) + activejob (= 6.1.7.3) + activesupport (= 6.1.7.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7) - actionview (= 6.1.7) - activesupport (= 6.1.7) + actionpack (6.1.7.3) + actionview (= 6.1.7.3) + activesupport (= 6.1.7.3) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7) - actionpack (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actiontext (6.1.7.3) + actionpack (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) nokogiri (>= 1.8.5) - actionview (6.1.7) - activesupport (= 6.1.7) + actionview (6.1.7.3) + activesupport (= 6.1.7.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7) - activesupport (= 6.1.7) + activejob (6.1.7.3) + activesupport (= 6.1.7.3) globalid (>= 0.3.6) - activemodel (6.1.7) - activesupport (= 6.1.7) - activerecord (6.1.7) - activemodel (= 6.1.7) - activesupport (= 6.1.7) - activestorage (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activesupport (= 6.1.7) + activemodel (6.1.7.3) + activesupport (= 6.1.7.3) + activerecord (6.1.7.3) + activemodel (= 6.1.7.3) + activesupport (= 6.1.7.3) + activestorage (6.1.7.3) + actionpack (= 6.1.7.3) + activejob (= 6.1.7.3) + activerecord (= 6.1.7.3) + activesupport (= 6.1.7.3) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7) + activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - appraisal (2.4.1) - bundler - rake - thor (>= 0.14.0) ast (2.4.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) date (3.3.3) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.0.0) + globalid (1.1.0) activesupport (>= 5.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.6.3) - language_server-protocol (3.17.0.2) - loofah (2.19.1) + language_server-protocol (3.17.0.3) + lint_roller (1.0.0) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -97,8 +103,8 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - minitest (5.17.0) - net-imap (0.3.4) + minitest (5.18.0) + net-imap (0.3.6) date net-protocol net-pop (0.1.2) @@ -107,50 +113,53 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0-arm64-darwin) + nio4r (2.5.9) + nokogiri (1.15.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) + nokogiri (1.15.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.15.2-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) + racc + racc (1.7.1) + rack (2.2.7) + rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7) - actioncable (= 6.1.7) - actionmailbox (= 6.1.7) - actionmailer (= 6.1.7) - actionpack (= 6.1.7) - actiontext (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activemodel (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + rails (6.1.7.3) + actioncable (= 6.1.7.3) + actionmailbox (= 6.1.7.3) + actionmailer (= 6.1.7.3) + actionpack (= 6.1.7.3) + actiontext (= 6.1.7.3) + actionview (= 6.1.7.3) + activejob (= 6.1.7.3) + activemodel (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) bundler (>= 1.15.0) - railties (= 6.1.7) + railties (= 6.1.7.3) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.1.7.3) + actionpack (= 6.1.7.3) + activesupport (= 6.1.7.3) method_source rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) rake (13.0.6) - redis (4.8.0) - regexp_parser (2.6.1) + redis-client (0.14.1) + connection_pool + regexp_parser (2.8.1) request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) @@ -158,43 +167,44 @@ GEM rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.2) + rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.1) + rspec-rails (6.0.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-support (3.12.0) - rubocop (1.42.0) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.18.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - sidekiq (6.5.8) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) + ruby-progressbar (1.13.0) + sidekiq (7.1.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) sprockets (4.2.0) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -202,22 +212,29 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.0.rc2-arm64-darwin) - sqlite3 (1.6.0.rc2-x86_64-darwin) - sqlite3 (1.6.0.rc2-x86_64-linux) - standard (1.21.1) + sqlite3 (1.6.3-arm64-darwin) + sqlite3 (1.6.3-x86_64-darwin) + sqlite3 (1.6.3-x86_64-linux) + standard (1.29.0) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) - thor (1.2.1) - timeout (0.3.1) - tzinfo (2.0.5) + lint_roller (~> 1.0) + rubocop (~> 1.52.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.1.0) + standard-custom (1.0.1) + lint_roller (~> 1.0) + standard-performance (1.1.0) + lint_roller (~> 1.0) + rubocop-performance (~> 1.18.0) + thor (1.2.2) + timeout (0.3.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.6) + zeitwerk (2.6.8) PLATFORMS arm64-darwin-22 @@ -228,16 +245,13 @@ PLATFORMS DEPENDENCIES acts_as_tenant! - appraisal + appraisal! byebug - net-imap - net-pop - net-smtp rails (~> 6.1.0, >= 6.1.4.1) rspec (>= 3.0) rspec-rails - sidekiq (~> 6.1, >= 6.1.2) - sqlite3 (~> 1.6.0.rc2) + sidekiq (~> 7.0) + sqlite3 standard BUNDLED WITH diff --git a/gemfiles/rails_7.gemfile b/gemfiles/rails_7.gemfile index ef624b19..195c1478 100644 --- a/gemfiles/rails_7.gemfile +++ b/gemfiles/rails_7.gemfile @@ -4,17 +4,11 @@ source "https://rubygems.org" gem "rspec", ">=3.0" gem "rspec-rails" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] gem "rails", "~> 7.0.0", ">= 7.0.0" -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end - gemspec path: "../" diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index bff4fef7..dbfa5e38 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: b200e636903700098bef25f4f51dbc4c46e4c04c + specs: + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + PATH remote: .. specs: @@ -8,94 +17,91 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + actioncable (7.0.5) + actionpack (= 7.0.5) + activesupport (= 7.0.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actionmailbox (7.0.5) + actionpack (= 7.0.5) + activejob (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) + actionmailer (7.0.5) + actionpack (= 7.0.5) + actionview (= 7.0.5) + activejob (= 7.0.5) + activesupport (= 7.0.5) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.5) + actionview (= 7.0.5) + activesupport (= 7.0.5) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actiontext (7.0.5) + actionpack (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (7.0.5) + activesupport (= 7.0.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) + activejob (7.0.5) + activesupport (= 7.0.5) globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) + activemodel (7.0.5) + activesupport (= 7.0.5) + activerecord (7.0.5) + activemodel (= 7.0.5) + activesupport (= 7.0.5) + activestorage (7.0.5) + actionpack (= 7.0.5) + activejob (= 7.0.5) + activerecord (= 7.0.5) + activesupport (= 7.0.5) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4) + activesupport (7.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - appraisal (2.4.1) - bundler - rake - thor (>= 0.14.0) ast (2.4.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) date (3.3.3) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.0.0) + globalid (1.1.0) activesupport (>= 5.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.6.3) - language_server-protocol (3.17.0.2) - loofah (2.19.1) + language_server-protocol (3.17.0.3) + lint_roller (1.0.0) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -103,9 +109,9 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.17.0) - net-imap (0.3.4) + mini_portile2 (2.8.2) + minitest (5.18.0) + net-imap (0.3.6) date net-protocol net-pop (0.1.2) @@ -114,51 +120,54 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0) - mini_portile2 (~> 2.8.0) + nio4r (2.5.9) + nokogiri (1.15.2) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) + nokogiri (1.15.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.15.2-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) + racc + racc (1.7.1) + rack (2.2.7) + rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rails (7.0.5) + actioncable (= 7.0.5) + actionmailbox (= 7.0.5) + actionmailer (= 7.0.5) + actionpack (= 7.0.5) + actiontext (= 7.0.5) + actionview (= 7.0.5) + activejob (= 7.0.5) + activemodel (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) bundler (>= 1.15.0) - railties (= 7.0.4) + railties (= 7.0.5) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.5) + actionpack (= 7.0.5) + activesupport (= 7.0.5) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - redis (4.8.0) - regexp_parser (2.6.1) + redis-client (0.14.1) + connection_pool + regexp_parser (2.8.1) request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) @@ -166,60 +175,68 @@ GEM rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.2) + rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.1) + rspec-rails (6.0.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-support (3.12.0) - rubocop (1.42.0) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.18.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - sidekiq (6.5.8) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) - sqlite3 (1.6.0.rc2) + ruby-progressbar (1.13.0) + sidekiq (7.1.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) + sqlite3 (1.6.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.0.rc2-x86_64-darwin) - sqlite3 (1.6.0.rc2-x86_64-linux) - standard (1.21.1) + sqlite3 (1.6.3-x86_64-darwin) + sqlite3 (1.6.3-x86_64-linux) + standard (1.29.0) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) - thor (1.2.1) - timeout (0.3.1) - tzinfo (2.0.5) + lint_roller (~> 1.0) + rubocop (~> 1.52.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.1.0) + standard-custom (1.0.1) + lint_roller (~> 1.0) + standard-performance (1.1.0) + lint_roller (~> 1.0) + rubocop-performance (~> 1.18.0) + thor (1.2.2) + timeout (0.3.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.6) + zeitwerk (2.6.8) PLATFORMS ruby @@ -228,16 +245,13 @@ PLATFORMS DEPENDENCIES acts_as_tenant! - appraisal + appraisal! byebug - net-imap - net-pop - net-smtp rails (~> 7.0.0, >= 7.0.0) rspec (>= 3.0) rspec-rails - sidekiq (~> 6.1, >= 6.1.2) - sqlite3 (~> 1.6.0.rc2) + sidekiq (~> 7.0) + sqlite3 standard BUNDLED WITH diff --git a/gemfiles/rails_main.gemfile b/gemfiles/rails_main.gemfile index 7f2d41d8..8294a662 100644 --- a/gemfiles/rails_main.gemfile +++ b/gemfiles/rails_main.gemfile @@ -4,10 +4,10 @@ source "https://rubygems.org" gem "rspec", git: "https://github.com/rspec/rspec.git", branch: "main" gem "rspec-rails", git: "https://github.com/rspec/rspec-rails.git", branch: "main" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 6.1", ">= 6.1.2" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] gem "rails", branch: :main, git: "https://github.com/rails/rails.git" gem "rspec-core", git: "https://github.com/rspec/rspec-core.git", branch: "main" @@ -15,10 +15,4 @@ gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations.git" gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks.git", branch: "main" gem "rspec-support", git: "https://github.com/rspec/rspec-support.git", branch: "main" -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end - gemspec path: "../" diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index cbd1c4ff..e65ef47b 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: bef58144b6398d34e93b873a8418391270f2c0db + revision: 87ab32f72a494ea18a4e2335becaebb66f5ce673 branch: main specs: actioncable (7.1.0.alpha) @@ -32,10 +32,12 @@ GIT actionpack (7.1.0.alpha) actionview (= 7.1.0.alpha) activesupport (= 7.1.0.alpha) - rack (~> 2.0, >= 2.2.4) + 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) + rails-html-sanitizer (~> 1.6) actiontext (7.1.0.alpha) actionpack (= 7.1.0.alpha) activerecord (= 7.1.0.alpha) @@ -48,7 +50,7 @@ GIT builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) + rails-html-sanitizer (~> 1.6) activejob (7.1.0.alpha) activesupport (= 7.1.0.alpha) globalid (>= 0.3.6) @@ -63,7 +65,6 @@ GIT activerecord (= 7.1.0.alpha) activesupport (= 7.1.0.alpha) marcel (~> 1.0) - mini_mime (>= 1.1.0) activesupport (7.1.0.alpha) concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) @@ -87,13 +88,15 @@ GIT railties (7.1.0.alpha) actionpack (= 7.1.0.alpha) activesupport (= 7.1.0.alpha) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) + thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) GIT remote: https://github.com/rspec/rspec-core.git - revision: 79ec0fd5b5ebd13031a10960f293b8a4a43cb734 + revision: 8caecca0b9b299ccbaa5c7ea5dd885ab42cd57d3 branch: main specs: rspec-core (3.13.0.pre) @@ -101,7 +104,7 @@ GIT GIT remote: https://github.com/rspec/rspec-expectations.git - revision: 4ef5b0e21c2273a14ff46b2382ab921e7b100d72 + revision: 8a468eea0a2ee456db4d6e2dccccd66ff269b862 branch: main specs: rspec-expectations (3.13.0.pre) @@ -110,7 +113,7 @@ GIT GIT remote: https://github.com/rspec/rspec-mocks.git - revision: 44d987e5ee9b09e20a97774eb1f4cf2972048649 + revision: 0d22620149a66d38ed03f60e96045721d71ce134 branch: main specs: rspec-mocks (3.13.0.pre) @@ -119,7 +122,7 @@ GIT GIT remote: https://github.com/rspec/rspec-rails.git - revision: 40261bb72875c00a6e4a0ca2ac697b660d4e8d9c + revision: ce4b5264ebb7ba7fb7a794782e334332faa33a20 branch: main specs: rspec-rails (6.1.0.pre) @@ -133,7 +136,7 @@ GIT GIT remote: https://github.com/rspec/rspec-support.git - revision: 9b9a81c0b38cd2fc6af69932e12f3eab2cee992a + revision: 6d33eaa48a761d616e23b81fc33b68a6e68ec296 branch: main specs: rspec-support (3.13.0.pre) @@ -148,6 +151,15 @@ GIT rspec-expectations (= 3.13.0.pre) rspec-mocks (= 3.13.0.pre) +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: b200e636903700098bef25f4f51dbc4c46e4c04c + specs: + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + PATH remote: .. specs: @@ -158,38 +170,38 @@ PATH GEM remote: https://rubygems.org/ specs: - appraisal (2.4.1) - bundler - rake - thor (>= 0.14.0) ast (2.4.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) date (3.3.3) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.0.0) + globalid (1.1.0) activesupport (>= 5.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) + io-console (0.6.0) + irb (1.7.0) + reline (>= 0.3.0) json (2.6.3) - language_server-protocol (3.17.0.2) - loofah (2.19.1) + language_server-protocol (3.17.0.3) + lint_roller (1.0.0) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp marcel (1.0.2) mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.17.0) - net-imap (0.3.4) + mini_portile2 (2.8.2) + minitest (5.18.0) + net-imap (0.3.6) date net-protocol net-pop (0.1.2) @@ -198,70 +210,89 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0) - mini_portile2 (~> 2.8.0) + nio4r (2.5.9) + nokogiri (1.15.2) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) + nokogiri (1.15.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.15.2-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) + racc + racc (1.7.1) + rack (3.0.8) + 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-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rainbow (3.1.1) rake (13.0.6) - redis (4.8.0) - regexp_parser (2.6.1) + redis-client (0.14.1) + connection_pool + regexp_parser (2.8.1) + reline (0.3.5) + io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) - rubocop (1.42.0) + rubocop (1.52.1) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.18.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - sidekiq (6.5.8) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) - sqlite3 (1.6.0.rc2) + ruby-progressbar (1.13.0) + sidekiq (7.1.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) + sqlite3 (1.6.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.0.rc2-x86_64-darwin) - sqlite3 (1.6.0.rc2-x86_64-linux) - standard (1.21.1) + sqlite3 (1.6.3-x86_64-darwin) + sqlite3 (1.6.3-x86_64-linux) + standard (1.29.0) language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) - thor (1.2.1) - timeout (0.3.1) - tzinfo (2.0.5) + lint_roller (~> 1.0) + rubocop (~> 1.52.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.1.0) + standard-custom (1.0.1) + lint_roller (~> 1.0) + standard-performance (1.1.0) + lint_roller (~> 1.0) + rubocop-performance (~> 1.18.0) + thor (1.2.2) + timeout (0.3.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) + webrick (1.8.1) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.6) + zeitwerk (2.6.8) PLATFORMS ruby @@ -270,11 +301,8 @@ PLATFORMS DEPENDENCIES acts_as_tenant! - appraisal + appraisal! byebug - net-imap - net-pop - net-smtp rails! rspec! rspec-core! @@ -282,8 +310,8 @@ DEPENDENCIES rspec-mocks! rspec-rails! rspec-support! - sidekiq (~> 6.1, >= 6.1.2) - sqlite3 (~> 1.6.0.rc2) + sidekiq (~> 7.0) + sqlite3 standard BUNDLED WITH diff --git a/gemfiles/sidekiq_7.gemfile b/gemfiles/sidekiq_6.gemfile similarity index 55% rename from gemfiles/sidekiq_7.gemfile rename to gemfiles/sidekiq_6.gemfile index 6bf50919..cb86f3cd 100644 --- a/gemfiles/sidekiq_7.gemfile +++ b/gemfiles/sidekiq_6.gemfile @@ -4,16 +4,10 @@ source "https://rubygems.org" gem "rspec", ">=3.0" gem "rspec-rails" -gem "sqlite3", "~> 1.6.0.rc2" -gem "sidekiq", "~> 7.0" +gem "sqlite3" gem "standard" -gem "appraisal" +gem "sidekiq", "~> 6.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] -group :development, :test do - gem "net-imap" - gem "net-pop" - gem "net-smtp" -end - gemspec path: "../" diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock new file mode 100644 index 00000000..c2560f8a --- /dev/null +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -0,0 +1,252 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: b200e636903700098bef25f4f51dbc4c46e4c04c + specs: + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + +PATH + remote: .. + specs: + acts_as_tenant (0.6.1) + rails (>= 5.2) + request_store (>= 1.0.5) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.5) + actionpack (= 7.0.5) + activesupport (= 7.0.5) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.5) + actionpack (= 7.0.5) + activejob (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.5) + actionpack (= 7.0.5) + actionview (= 7.0.5) + activejob (= 7.0.5) + activesupport (= 7.0.5) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.5) + actionview (= 7.0.5) + activesupport (= 7.0.5) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.5) + actionpack (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.5) + activesupport (= 7.0.5) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.5) + activesupport (= 7.0.5) + globalid (>= 0.3.6) + activemodel (7.0.5) + activesupport (= 7.0.5) + activerecord (7.0.5) + activemodel (= 7.0.5) + activesupport (= 7.0.5) + activestorage (7.0.5) + actionpack (= 7.0.5) + activejob (= 7.0.5) + activerecord (= 7.0.5) + activesupport (= 7.0.5) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.5) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + ast (2.4.2) + builder (3.2.4) + byebug (11.1.3) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + crass (1.0.6) + date (3.3.3) + diff-lcs (1.5.0) + erubi (1.12.0) + globalid (1.1.0) + activesupport (>= 5.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.6.3) + language_server-protocol (3.17.0.3) + lint_roller (1.0.0) + loofah (2.21.3) + 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.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.18.0) + net-imap (0.3.6) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.9) + nokogiri (1.15.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.15.2-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.2-x86_64-linux) + racc (~> 1.4) + parallel (1.23.0) + parser (3.2.2.3) + ast (~> 2.4.1) + racc + racc (1.7.1) + rack (2.2.7) + rack-test (2.1.0) + rack (>= 1.3) + rails (7.0.5) + actioncable (= 7.0.5) + actionmailbox (= 7.0.5) + actionmailer (= 7.0.5) + actionpack (= 7.0.5) + actiontext (= 7.0.5) + actionview (= 7.0.5) + activejob (= 7.0.5) + activemodel (= 7.0.5) + activerecord (= 7.0.5) + activestorage (= 7.0.5) + activesupport (= 7.0.5) + bundler (>= 1.15.0) + railties (= 7.0.5) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.5) + actionpack (= 7.0.5) + activesupport (= 7.0.5) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.0.6) + redis (4.8.1) + regexp_parser (2.8.1) + request_store (1.5.1) + rack (>= 1.4) + rexml (3.2.5) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-rails (6.0.3) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.0) + rubocop (1.52.1) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.2.2.3) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.18.0) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + ruby-progressbar (1.13.0) + sidekiq (6.5.9) + connection_pool (>= 2.2.5, < 3) + rack (~> 2.0) + redis (>= 4.5.0, < 5) + sqlite3 (1.6.3-arm64-darwin) + sqlite3 (1.6.3-x86_64-darwin) + sqlite3 (1.6.3-x86_64-linux) + standard (1.29.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.52.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.1.0) + standard-custom (1.0.1) + lint_roller (~> 1.0) + standard-performance (1.1.0) + lint_roller (~> 1.0) + rubocop-performance (~> 1.18.0) + thor (1.2.2) + timeout (0.3.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.4.2) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.8) + +PLATFORMS + arm64-darwin-22 + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + acts_as_tenant! + appraisal! + byebug + rspec (>= 3.0) + rspec-rails + sidekiq (~> 6.0) + sqlite3 + standard + +BUNDLED WITH + 2.3.26 diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock deleted file mode 100644 index b2fbce33..00000000 --- a/gemfiles/sidekiq_7.gemfile.lock +++ /dev/null @@ -1,242 +0,0 @@ -PATH - remote: .. - specs: - acts_as_tenant (0.6.1) - rails (>= 5.2) - request_store (>= 1.0.5) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) - globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) - marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - appraisal (2.4.1) - bundler - rake - thor (>= 0.14.0) - ast (2.4.2) - builder (3.2.4) - byebug (11.1.3) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) - crass (1.0.6) - date (3.3.3) - diff-lcs (1.5.0) - erubi (1.12.0) - globalid (1.0.0) - activesupport (>= 5.0) - i18n (1.12.0) - concurrent-ruby (~> 1.0) - json (2.6.3) - language_server-protocol (3.17.0.2) - loofah (2.19.1) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) - mini_mime (>= 0.1.1) - net-imap - net-pop - net-smtp - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.17.0) - net-imap (0.3.4) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.1) - timeout - net-smtp (0.3.3) - net-protocol - nio4r (2.5.8) - nokogiri (1.14.0-arm64-darwin) - racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) - racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) - ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) - rack (>= 1.3) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - bundler (>= 1.15.0) - railties (= 7.0.4) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - method_source - rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rainbow (3.1.1) - rake (13.0.6) - redis-client (0.12.0) - connection_pool - regexp_parser (2.6.1) - request_store (1.5.1) - rack (>= 1.4) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.0.1) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) - rspec-support (3.12.0) - rubocop (1.42.0) - json (~> 2.3) - parallel (~> 1.10) - parser (>= 3.1.2.1) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - sidekiq (7.0.3) - concurrent-ruby (< 2) - connection_pool (>= 2.3.0) - rack (>= 2.2.4) - redis-client (>= 0.11.0) - sqlite3 (1.6.0.rc2-arm64-darwin) - sqlite3 (1.6.0.rc2-x86_64-darwin) - sqlite3 (1.6.0.rc2-x86_64-linux) - standard (1.21.1) - language_server-protocol (~> 3.17.0.2) - rubocop (= 1.42.0) - rubocop-performance (= 1.15.2) - thor (1.2.1) - timeout (0.3.1) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - zeitwerk (2.6.6) - -PLATFORMS - arm64-darwin-22 - x86_64-darwin-22 - x86_64-linux - -DEPENDENCIES - acts_as_tenant! - appraisal - byebug - net-imap - net-pop - net-smtp - rspec (>= 3.0) - rspec-rails - sidekiq (~> 7.0) - sqlite3 (~> 1.6.0.rc2) - standard - -BUNDLED WITH - 2.3.26 diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index 1fa29209..e655c1eb 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -1,5 +1,4 @@ require "spec_helper" -require "sidekiq" require "acts_as_tenant/sidekiq" describe ActsAsTenant::Sidekiq do From 34fd07e35d493137afb9e0ae0c839ab7a8abea8b Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 15 Jun 2023 17:10:25 -0500 Subject: [PATCH 09/31] Defer Sidekiq extension to after ActiveRecord loads --- lib/acts_as_tenant.rb | 2 +- spec/acts_as_tenant/sidekiq_spec.rb | 2 +- spec/spec_helper.rb | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index 7e5765fd..ca4160fd 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -2,7 +2,6 @@ require "acts_as_tenant/version" require "acts_as_tenant/errors" -require "acts_as_tenant/sidekiq" if defined?(Sidekiq) module ActsAsTenant autoload :Configuration, "acts_as_tenant/configuration" @@ -148,6 +147,7 @@ def self.should_require_tenant? ActiveSupport.on_load(:active_record) do |base| base.include ActsAsTenant::ModelExtensions + require "acts_as_tenant/sidekiq" if defined?(::Sidekiq) end ActiveSupport.on_load(:action_controller) do |base| diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index aa59d6ae..68521755 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe "ActsAsTenant::Sidekiq", sidekiq: true do +describe "ActsAsTenant::Sidekiq" do let(:account) { Account.new(id: 1234) } let(:message) { {"acts_as_tenant" => {"class" => "Account", "id" => 1234}} } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b5bf01e0..03c27e3d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,9 +17,4 @@ config.global_fixtures = :all config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = true - config.filter_run_when_matching :focus - - unless defined?(Sidekiq) - config.filter_run_excluding sidekiq: true - end end From 23daba52818b3888efbf534f4282d8f6197030e2 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Mon, 19 Jun 2023 14:41:01 -0500 Subject: [PATCH 10/31] Add job_scope configuration --- CHANGELOG.md | 11 +++++++ README.md | 3 ++ lib/acts_as_tenant/configuration.rb | 18 +++++++++++ lib/acts_as_tenant/sidekiq.rb | 4 ++- spec/acts_as_tenant/sidekiq_spec.rb | 48 ++++++++++++++--------------- 5 files changed, 59 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b6be369..f6242faf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Unreleased ---------- +* Add `scope` support to `acts_as_tenant :account, ->{ with_deleted }` #282 - @adrian-gomez + The scope will be forwarded to `belongs_to`. +* Add `job_scope` configuration to customize how tenants are loaded in background jobs - @excid3 + This is helpful for situations like soft delete: + +```ruby +ActsAsTenant.configure do |config| + config.job_scope = ->{ with_deleted } +end +``` + * Easy integration with Sidekiq, not requiring to add any configuration to the initializer - @nunommc 0.6.1 diff --git a/README.md b/README.md index 279dbe57..fd0c8686 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,9 @@ are shown below with sample overrides following. In `config/initializers/acts_as ```ruby ActsAsTenant.configure do |config| config.require_tenant = false # true + + # Customize the query for loading the tenant in background jobs + config.job_scope = ->{ all } end ``` diff --git a/lib/acts_as_tenant/configuration.rb b/lib/acts_as_tenant/configuration.rb index cd60c6ff..e75ebcfc 100644 --- a/lib/acts_as_tenant/configuration.rb +++ b/lib/acts_as_tenant/configuration.rb @@ -9,5 +9,23 @@ def require_tenant def pkey @pkey ||= :id end + + def job_scope + @job_scope || ->(relation) { relation.all } + end + + # Used for looking job tenants in background jobs + # + # Format matches Rails scopes + # + # job_scope = ->(relation) {} + # job_scope = -> {} + def job_scope=(scope) + @job_scope = if scope && scope.arity == 0 + proc { instance_exec(&scope) } + else + scope + end + end end end diff --git a/lib/acts_as_tenant/sidekiq.rb b/lib/acts_as_tenant/sidekiq.rb index c30a9227..bdab2c74 100644 --- a/lib/acts_as_tenant/sidekiq.rb +++ b/lib/acts_as_tenant/sidekiq.rb @@ -28,7 +28,9 @@ class Server < BaseMiddleware def call(worker_class, msg, queue) if msg.has_key?("acts_as_tenant") - account = msg["acts_as_tenant"]["class"].constantize.unscoped.find msg["acts_as_tenant"]["id"] + klass = msg["acts_as_tenant"]["class"].constantize + id = msg["acts_as_tenant"]["id"] + account = klass.class_eval(&ActsAsTenant.configuration.job_scope).find(id) ActsAsTenant.with_tenant account do yield end diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index 46aa3111..208dbec8 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -27,37 +27,37 @@ describe "ActsAsTenant::Sidekiq::Server" do subject { ActsAsTenant::Sidekiq::Server.new } - context "when tenant exist" do - before { account.save } - - it "restores tenant" do - msg = message - subject.call(nil, msg, nil) do - expect(ActsAsTenant.current_tenant).to be_a_kind_of Account - end - expect(ActsAsTenant.current_tenant).to be_nil + it "restores tenant if tenant saved" do + Account.create!(id: 1234) + msg = message + subject.call(nil, msg, nil) do + expect(ActsAsTenant.current_tenant).to be_a_kind_of Account end + expect(ActsAsTenant.current_tenant).to be_nil + end - context "but it is outside its own scope" do - before { account.update!(deleted_at: Time.now) } + it "runs without tenant if no tenant saved" do + expect(Account).not_to receive(:find) - it "ignores the scope and sets the tenant" do - msg = {} - subject.call(nil, message, nil) do - expect(ActsAsTenant.current_tenant).to eq(account) - end - end + msg = {} + subject.call(nil, msg, nil) do + expect(ActsAsTenant.current_tenant).to be_nil end + expect(ActsAsTenant.current_tenant).to be_nil end - context "when tenant does not exist" do - it "runs without tenant" do - msg = {} - subject.call(nil, msg, nil) do - expect(ActsAsTenant.current_tenant).to be_nil - end - expect(ActsAsTenant.current_tenant).to be_nil + it "restores tenant with custom scope" do + original_job_scope = ActsAsTenant.configuration.job_scope + ActsAsTenant.configuration.job_scope = ->{ unscope(where: :deleted_at) } + + Account.create!(id: 1234, deleted_at: 1.day.ago) + msg = message + subject.call(nil, msg, nil) do + expect(ActsAsTenant.current_tenant).to be_a_kind_of Account end + expect(ActsAsTenant.current_tenant).to be_nil + ensure + ActsAsTenant.configuration.job_scope = original_job_scope end end From 0dd17c474830c90446085caa8eb19fc0446ff932 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Mon, 19 Jun 2023 14:49:20 -0500 Subject: [PATCH 11/31] Standardize --- spec/acts_as_tenant/sidekiq_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index 208dbec8..b5b150fc 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -48,7 +48,7 @@ it "restores tenant with custom scope" do original_job_scope = ActsAsTenant.configuration.job_scope - ActsAsTenant.configuration.job_scope = ->{ unscope(where: :deleted_at) } + ActsAsTenant.configuration.job_scope = -> { unscope(where: :deleted_at) } Account.create!(id: 1234, deleted_at: 1.day.ago) msg = message From 87529732f027a208828b21933bbf9fab807e0cfa Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 21 Jun 2023 08:59:58 -0500 Subject: [PATCH 12/31] Mention acts_as_tenant-delayed_job in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fd0c8686..c9020a01 100644 --- a/README.md +++ b/README.md @@ -301,6 +301,7 @@ Background Processing libraries ActsAsTenant supports - [Sidekiq](//sidekiq.org/) - make sure to place acts_as_tenant gem after sidekiq in your gemfiles; +- DelayedJob - [acts_as_tenant-delayed_job](https://github.com/nunommc/acts_as_tenant-delayed_job) Testing --------------- From d29185f14a0be2cad6b3ca1090ed716a8c183c2b Mon Sep 17 00:00:00 2001 From: Tys von Gaza Date: Wed, 4 Oct 2023 22:50:54 -0600 Subject: [PATCH 13/31] Update README.md with small dev console QoL suggestion (#322) Adds a section on having your rails console automatically set the current tenant on load/reload while in development. I know this has saved our team a lot of time by reducing some dev friction. --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index c9020a01..68816689 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,31 @@ end `ActsAsTenant.should_require_tenant?` is used to determine if a tenant is required in the current context, either by evaluating the lambda provided, or by returning the boolean value assigned to `config.require_tenant`. +When using `config.require_tenant` alongside the `rails console`, a nice quality of life tweak is to set the tenant in the console session in your initializer script. For example in `config/initializers/acts_as_tenant.rb`: + +```ruby +SET_TENANT_PROC = lambda do + if defined?(Rails::Console) + puts "> ActsAsTenant.current_tenant = Account.first" + ActsAsTenant.current_tenant = Account.first + end +end + +Rails.application.configure do + if Rails.env.development? + # Set the tenant to the first account in development on load + config.after_initialize do + SET_TENANT_PROC.call + end + + # Reset the tenant after calling 'reload!' in the console + ActiveSupport::Reloader.to_complete do + SET_TENANT_PROC.call + end + end +end +``` + belongs_to options ------------------ From 0497b2934aeaa1ab6fda3ba0fe964e154cc54bb7 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 15:51:22 -0600 Subject: [PATCH 14/31] Replace RequestStore dependency with CurrentAttributes (#313) * Replace RequestStore dependency with CurrentAttributes * Update appraisals * Update lib/acts_as_tenant.rb * Update changelog --- CHANGELOG.md | 4 ++-- acts_as_tenant.gemspec | 1 - gemfiles/rails_5.gemfile.lock | 3 --- gemfiles/rails_6.gemfile.lock | 3 --- gemfiles/rails_6_1.gemfile.lock | 3 --- gemfiles/rails_7.gemfile.lock | 3 --- gemfiles/rails_main.gemfile.lock | 3 --- gemfiles/sidekiq_6.gemfile.lock | 3 --- lib/acts_as_tenant.rb | 15 +++++++++------ spec/models/model_extensions_spec.rb | 6 ------ 10 files changed, 11 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6242faf..42c0fa63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ Unreleased ---------- +* Replace RequestStore dependency with CurrentAttributes. #313 - @excid3 +* Easy integration with Sidekiq, not requiring to add any configuration to the initializer #314 - @nunommc * Add `scope` support to `acts_as_tenant :account, ->{ with_deleted }` #282 - @adrian-gomez The scope will be forwarded to `belongs_to`. * Add `job_scope` configuration to customize how tenants are loaded in background jobs - @excid3 @@ -12,8 +14,6 @@ ActsAsTenant.configure do |config| end ``` -* Easy integration with Sidekiq, not requiring to add any configuration to the initializer - @nunommc - 0.6.1 ----- diff --git a/acts_as_tenant.gemspec b/acts_as_tenant.gemspec index 96a686f5..784f9e9a 100644 --- a/acts_as_tenant.gemspec +++ b/acts_as_tenant.gemspec @@ -14,6 +14,5 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] - spec.add_dependency "request_store", ">= 1.0.5" spec.add_dependency "rails", ">= 5.2" end diff --git a/gemfiles/rails_5.gemfile.lock b/gemfiles/rails_5.gemfile.lock index 75fe9c9d..af1e2d7d 100644 --- a/gemfiles/rails_5.gemfile.lock +++ b/gemfiles/rails_5.gemfile.lock @@ -12,7 +12,6 @@ PATH specs: acts_as_tenant (0.6.1) rails (>= 5.2) - request_store (>= 1.0.5) GEM remote: https://rubygems.org/ @@ -141,8 +140,6 @@ GEM redis-client (0.14.1) connection_pool regexp_parser (2.8.1) - request_store (1.5.1) - rack (>= 1.4) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 813516fb..9ed60cfd 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -12,7 +12,6 @@ PATH specs: acts_as_tenant (0.6.1) rails (>= 5.2) - request_store (>= 1.0.5) GEM remote: https://rubygems.org/ @@ -156,8 +155,6 @@ GEM redis-client (0.14.1) connection_pool regexp_parser (2.8.1) - request_store (1.5.1) - rack (>= 1.4) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index c229e2a9..f1aa5878 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -12,7 +12,6 @@ PATH specs: acts_as_tenant (0.6.1) rails (>= 5.2) - request_store (>= 1.0.5) GEM remote: https://rubygems.org/ @@ -160,8 +159,6 @@ GEM redis-client (0.14.1) connection_pool regexp_parser (2.8.1) - request_store (1.5.1) - rack (>= 1.4) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index dbfa5e38..c52a8c6f 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -12,7 +12,6 @@ PATH specs: acts_as_tenant (0.6.1) rails (>= 5.2) - request_store (>= 1.0.5) GEM remote: https://rubygems.org/ @@ -168,8 +167,6 @@ GEM redis-client (0.14.1) connection_pool regexp_parser (2.8.1) - request_store (1.5.1) - rack (>= 1.4) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index e65ef47b..d205e266 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -165,7 +165,6 @@ PATH specs: acts_as_tenant (0.6.1) rails (>= 5.2) - request_store (>= 1.0.5) GEM remote: https://rubygems.org/ @@ -244,8 +243,6 @@ GEM regexp_parser (2.8.1) reline (0.3.5) io-console (~> 0.5) - request_store (1.5.1) - rack (>= 1.4) rexml (3.2.5) rubocop (1.52.1) json (~> 2.3) diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock index c2560f8a..b11da8f8 100644 --- a/gemfiles/sidekiq_6.gemfile.lock +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -12,7 +12,6 @@ PATH specs: acts_as_tenant (0.6.1) rails (>= 5.2) - request_store (>= 1.0.5) GEM remote: https://rubygems.org/ @@ -165,8 +164,6 @@ GEM rake (13.0.6) redis (4.8.1) regexp_parser (2.8.1) - request_store (1.5.1) - rack (>= 1.4) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index ca4160fd..6e896f1e 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -1,5 +1,4 @@ -require "request_store" - +require "active_support/current_attributes" require "acts_as_tenant/version" require "acts_as_tenant/errors" @@ -14,6 +13,10 @@ module ActsAsTenant @@models_with_global_records = [] @@mutable_tenant = false + class Current < ActiveSupport::CurrentAttributes + attribute :current_tenant, :acts_as_tenant_unscoped + end + class << self attr_writer :default_tenant end @@ -57,11 +60,11 @@ def self.polymorphic_type end def self.current_tenant=(tenant) - RequestStore.store[:current_tenant] = tenant + Current.current_tenant = tenant end def self.current_tenant - RequestStore.store[:current_tenant] || test_tenant || default_tenant + Current.current_tenant || test_tenant || default_tenant end def self.test_tenant=(tenant) @@ -73,11 +76,11 @@ def self.test_tenant end def self.unscoped=(unscoped) - RequestStore.store[:acts_as_tenant_unscoped] = unscoped + Current.acts_as_tenant_unscoped = unscoped end def self.unscoped - RequestStore.store[:acts_as_tenant_unscoped] + Current.acts_as_tenant_unscoped end def self.unscoped? diff --git a/spec/models/model_extensions_spec.rb b/spec/models/model_extensions_spec.rb index ec1a92a9..ef6f25ba 100644 --- a/spec/models/model_extensions_spec.rb +++ b/spec/models/model_extensions_spec.rb @@ -504,11 +504,5 @@ ActsAsTenant.default_tenant = account expect(ActsAsTenant.current_tenant).to eq(accounts(:bar)) end - - it "survives request resets" do - ActsAsTenant.default_tenant = account - RequestStore.clear! - expect(ActsAsTenant.current_tenant).to eq(account) - end end end From 69d216226fc904ae7c73ee3ddd74bb42b44968cb Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Thu, 7 Dec 2023 10:08:22 +1100 Subject: [PATCH 15/31] Disable legacy_connection_handling on Rails 6.1+ (#308) A new Active Record connection handler was added in Rails 6.1, however, the old one remains the default for upgraded applications and throws deprecation warnings under Rails 7 --- spec/dummy/config/application.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 7a57bb4c..f2b593b8 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -15,5 +15,9 @@ class Application < Rails::Application if Rails.gem_version < Gem::Version.new("6.0") && config.active_record.sqlite3 config.active_record.sqlite3.represent_boolean_as_integer = true end + + if Rails.gem_version >= Gem::Version.new("6.1") + config.active_record.legacy_connection_handling = false + end end end From 6ecf5d2d2e74338362142f5a52464a65ee6dae7c Mon Sep 17 00:00:00 2001 From: Tys von Gaza Date: Wed, 6 Dec 2023 18:25:38 -0700 Subject: [PATCH 16/31] Add a new ActiveJobExtensions which hooks into the serialization and deserialization of an ActiveJob to preserve the current tenant. (#319) --- lib/acts_as_tenant.rb | 5 +++ lib/acts_as_tenant/active_job_extensions.rb | 13 ++++++ spec/jobs/active_job_extensions_spec.rb | 49 +++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 lib/acts_as_tenant/active_job_extensions.rb create mode 100644 spec/jobs/active_job_extensions_spec.rb diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index 6e896f1e..5ab99ad6 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -7,6 +7,7 @@ module ActsAsTenant autoload :ControllerExtensions, "acts_as_tenant/controller_extensions" autoload :ModelExtensions, "acts_as_tenant/model_extensions" autoload :TenantHelper, "acts_as_tenant/tenant_helper" + autoload :ActiveJobExtensions, "acts_as_tenant/active_job_extensions" @@configuration = nil @@tenant_klass = nil @@ -161,3 +162,7 @@ def self.should_require_tenant? ActiveSupport.on_load(:action_view) do |base| base.include ActsAsTenant::TenantHelper end + +ActiveSupport.on_load(:active_job) do |base| + base.prepend ActsAsTenant::ActiveJobExtensions +end diff --git a/lib/acts_as_tenant/active_job_extensions.rb b/lib/acts_as_tenant/active_job_extensions.rb new file mode 100644 index 00000000..b9b5d967 --- /dev/null +++ b/lib/acts_as_tenant/active_job_extensions.rb @@ -0,0 +1,13 @@ +module ActsAsTenant + module ActiveJobExtensions + def serialize + super.merge("current_tenant" => ActsAsTenant.current_tenant&.to_global_id) + end + + def deserialize(job_data) + tenant_global_id = job_data.delete("current_tenant") + ActsAsTenant.current_tenant = tenant_global_id ? GlobalID::Locator.locate(tenant_global_id) : nil + super + end + end +end diff --git a/spec/jobs/active_job_extensions_spec.rb b/spec/jobs/active_job_extensions_spec.rb new file mode 100644 index 00000000..548f2059 --- /dev/null +++ b/spec/jobs/active_job_extensions_spec.rb @@ -0,0 +1,49 @@ +require "spec_helper" + +class ApplicationTestJob < ApplicationJob + def perform(expected_tenant:) + raise ApplicationTestJobTenantError unless ActsAsTenant.current_tenant == expected_tenant + Project.all + end +end + +class ApplicationTestJobTenantError < StandardError; end + +RSpec.describe ApplicationTestJob, type: :job do + include ActiveJob::TestHelper + + let(:account) { accounts(:foo) } + + describe "#perform_later" do + context "when tenant is required" do + before { allow(ActsAsTenant.configuration).to receive_messages(require_tenant: true) } + + it "raises ApplicationTestJobTenantError when expected_tenant does not match current_tenant" do + ActsAsTenant.current_tenant = account + expect { described_class.perform_later(expected_tenant: nil) }.to have_enqueued_job.on_queue("default") + expect { perform_enqueued_jobs }.to raise_error(ApplicationTestJobTenantError) + end + + it "when tenant is set, successfully queues and performs job" do + ActsAsTenant.current_tenant = account + expect { described_class.perform_later(expected_tenant: account) }.to have_enqueued_job.on_queue("default") + expect { perform_enqueued_jobs }.not_to raise_error + end + + it "when tenant is not set, successfully queues but fails to perform job" do + ActsAsTenant.current_tenant = nil + expect { described_class.perform_later(expected_tenant: nil) }.to have_enqueued_job.on_queue("default") + expect { perform_enqueued_jobs }.to raise_error(ActsAsTenant::Errors::NoTenantSet) + end + end + + context "when tenant is not required" do + before { allow(ActsAsTenant.configuration).to receive_messages(require_tenant: false) } + it "when tenant is not set, queues and performs job" do + ActsAsTenant.current_tenant = nil + expect { described_class.perform_later(expected_tenant: nil) }.to have_enqueued_job.on_queue("default") + expect { perform_enqueued_jobs }.not_to raise_error + end + end + end +end From 02be9beeb3355245bbc9e8eecd4293c55ef5cf2a Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 19:41:24 -0600 Subject: [PATCH 17/31] Revert legacy connection handling config for dummy app --- spec/dummy/config/application.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index f2b593b8..7a57bb4c 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -15,9 +15,5 @@ class Application < Rails::Application if Rails.gem_version < Gem::Version.new("6.0") && config.active_record.sqlite3 config.active_record.sqlite3.represent_boolean_as_integer = true end - - if Rails.gem_version >= Gem::Version.new("6.1") - config.active_record.legacy_connection_handling = false - end end end From 6fd5edb74c2be30fb06e6a4c744e97af3292bfcd Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 19:46:18 -0600 Subject: [PATCH 18/31] Update appraisals --- .github/workflows/ci.yml | 2 + Appraisals | 16 +- gemfiles/rails_5.gemfile | 2 +- gemfiles/rails_5.gemfile.lock | 101 +++++------ gemfiles/rails_6.gemfile | 2 +- gemfiles/rails_6.gemfile.lock | 103 +++++------ gemfiles/rails_6_1.gemfile | 2 +- gemfiles/rails_6_1.gemfile.lock | 215 +++++++++++------------ gemfiles/rails_7.gemfile | 2 +- gemfiles/rails_7.gemfile.lock | 215 +++++++++++------------ gemfiles/rails_7_1.gemfile | 14 ++ gemfiles/rails_7_1.gemfile.lock | 287 +++++++++++++++++++++++++++++++ gemfiles/rails_main.gemfile.lock | 249 ++++++++++++++------------- gemfiles/sidekiq_6.gemfile.lock | 265 +++++++++++++++------------- gemfiles/sidekiq_7.gemfile | 13 ++ gemfiles/sidekiq_7.gemfile.lock | 286 ++++++++++++++++++++++++++++++ 16 files changed, 1225 insertions(+), 549 deletions(-) create mode 100644 gemfiles/rails_7_1.gemfile create mode 100644 gemfiles/rails_7_1.gemfile.lock create mode 100644 gemfiles/sidekiq_7.gemfile create mode 100644 gemfiles/sidekiq_7.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85c2c1e4..86d12c07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,10 @@ jobs: - rails_6 - rails_6_1 - rails_7 + - rails_7_1 - rails_main - sidekiq_6 + - sidekiq_7 exclude: - ruby: '3.0' gemfile: rails_5 diff --git a/Appraisals b/Appraisals index a272c2ce..376fcbbd 100644 --- a/Appraisals +++ b/Appraisals @@ -1,17 +1,21 @@ appraise "rails-5" do - gem "rails", "~> 5.2.0", ">= 5.2.6" + gem "rails", "~> 5.2.0" end appraise "rails-6" do - gem "rails", "~> 6.0.0", ">= 6.0.4.1" + gem "rails", "~> 6.0.0" end appraise "rails-6-1" do - gem "rails", "~> 6.1.0", ">= 6.1.4.1" + gem "rails", "~> 6.1.0" end appraise "rails-7" do - gem "rails", "~> 7.0.0", ">= 7.0.0" + gem "rails", "~> 7.0.0" +end + +appraise "rails-7-1" do + gem "rails", "~> 7.1.0" end appraise "rails-main" do @@ -24,3 +28,7 @@ end appraise "sidekiq-6" do gem "sidekiq", "~> 6.0" end + +appraise "sidekiq-7" do + gem "sidekiq", "~> 7.0" +end diff --git a/gemfiles/rails_5.gemfile b/gemfiles/rails_5.gemfile index 931d27db..3689cdae 100644 --- a/gemfiles/rails_5.gemfile +++ b/gemfiles/rails_5.gemfile @@ -9,6 +9,6 @@ gem "standard" gem "sidekiq", "~> 7.0" gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] -gem "rails", "~> 5.2.0", ">= 5.2.6" +gem "rails", "~> 5.2.0" gemspec path: "../" diff --git a/gemfiles/rails_5.gemfile.lock b/gemfiles/rails_5.gemfile.lock index af1e2d7d..8428415b 100644 --- a/gemfiles/rails_5.gemfile.lock +++ b/gemfiles/rails_5.gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/thoughtbot/appraisal.git - revision: b200e636903700098bef25f4f51dbc4c46e4c04c + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a specs: - appraisal (2.4.1) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -64,17 +64,17 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) globalid (1.1.0) activesupport (>= 5.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) - lint_roller (1.0.0) - loofah (2.21.3) + lint_roller (1.1.0) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -84,30 +84,30 @@ GEM net-smtp marcel (1.0.2) method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.18.0) - net-imap (0.3.6) + mini_mime (1.1.5) + minitest (5.20.0) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.2-arm64-darwin) + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc - racc (1.7.1) - rack (2.2.7) + racc (1.7.3) + rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) rails (5.2.8.1) @@ -123,8 +123,9 @@ GEM bundler (>= 1.3.0) railties (= 5.2.8.1) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) @@ -136,11 +137,11 @@ GEM rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.1.1) - rake (13.0.6) - redis-client (0.14.1) + rake (13.1.0) + redis-client (0.18.0) connection_pool - regexp_parser (2.8.1) - rexml (3.2.5) + regexp_parser (2.8.3) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -150,7 +151,7 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (5.1.2) @@ -161,56 +162,58 @@ GEM rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) - rspec-support (3.12.0) - rubocop (1.52.1) + rspec-support (3.12.1) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - sidekiq (7.1.2) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.3-arm64-darwin) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - standard (1.29.0) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.57.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) - standard-custom (1.0.1) + standard-performance (~> 1.2) + standard-custom (1.0.2) lint_roller (~> 1.0) - standard-performance (1.1.0) - lint_roller (~> 1.0) - rubocop-performance (~> 1.18.0) - thor (1.2.2) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + thor (1.3.0) thread_safe (0.3.6) - timeout (0.3.2) + timeout (0.4.1) tzinfo (1.2.11) thread_safe (~> 0.1) - unicode-display_width (2.4.2) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -225,7 +228,7 @@ DEPENDENCIES acts_as_tenant! appraisal! byebug - rails (~> 5.2.0, >= 5.2.6) + rails (~> 5.2.0) rspec (>= 3.0) rspec-rails sidekiq (~> 7.0) @@ -233,4 +236,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.4.3 + 2.4.22 diff --git a/gemfiles/rails_6.gemfile b/gemfiles/rails_6.gemfile index 991ccd7f..d0e96774 100644 --- a/gemfiles/rails_6.gemfile +++ b/gemfiles/rails_6.gemfile @@ -9,6 +9,6 @@ gem "standard" gem "sidekiq", "~> 7.0" gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] -gem "rails", "~> 6.0.0", ">= 6.0.4.1" +gem "rails", "~> 6.0.0" gemspec path: "../" diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 9ed60cfd..67c8b6cc 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/thoughtbot/appraisal.git - revision: b200e636903700098bef25f4f51dbc4c46e4c04c + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a specs: - appraisal (2.4.1) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -77,17 +77,17 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) globalid (1.1.0) activesupport (>= 5.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) - lint_roller (1.0.0) - loofah (2.21.3) + lint_roller (1.1.0) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -97,30 +97,30 @@ GEM net-smtp marcel (1.0.2) method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.18.0) - net-imap (0.3.6) + mini_mime (1.1.5) + minitest (5.20.0) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.2-arm64-darwin) + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc - racc (1.7.1) - rack (2.2.7) + racc (1.7.3) + rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) rails (6.0.6.1) @@ -138,8 +138,9 @@ GEM bundler (>= 1.3.0) railties (= 6.0.6.1) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) @@ -151,11 +152,11 @@ GEM rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rainbow (3.1.1) - rake (13.0.6) - redis-client (0.14.1) + rake (13.1.0) + redis-client (0.18.0) connection_pool - regexp_parser (2.8.1) - rexml (3.2.5) + regexp_parser (2.8.3) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -165,7 +166,7 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (5.1.2) @@ -176,59 +177,61 @@ GEM rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) - rspec-support (3.12.0) - rubocop (1.52.1) + rspec-support (3.12.1) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - sidekiq (7.1.2) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.3-arm64-darwin) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - standard (1.29.0) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.57.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) - standard-custom (1.0.1) + standard-performance (~> 1.2) + standard-custom (1.0.2) lint_roller (~> 1.0) - standard-performance (1.1.0) - lint_roller (~> 1.0) - rubocop-performance (~> 1.18.0) - thor (1.2.2) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + thor (1.3.0) thread_safe (0.3.6) - timeout (0.3.2) + timeout (0.4.1) tzinfo (1.2.11) thread_safe (~> 0.1) - unicode-display_width (2.4.2) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.8) + zeitwerk (2.6.12) PLATFORMS arm64-darwin-22 @@ -241,7 +244,7 @@ DEPENDENCIES acts_as_tenant! appraisal! byebug - rails (~> 6.0.0, >= 6.0.4.1) + rails (~> 6.0.0) rspec (>= 3.0) rspec-rails sidekiq (~> 7.0) @@ -249,4 +252,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.4.3 + 2.4.22 diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index 3ef140f3..8ce40b26 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -9,6 +9,6 @@ gem "standard" gem "sidekiq", "~> 7.0" gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] -gem "rails", "~> 6.1.0", ">= 6.1.4.1" +gem "rails", "~> 6.1.0" gemspec path: "../" diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index f1aa5878..11638f27 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/thoughtbot/appraisal.git - revision: b200e636903700098bef25f4f51dbc4c46e4c04c + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a specs: - appraisal (2.4.1) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -16,60 +16,60 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.3) - actionpack (= 6.1.7.3) - activesupport (= 6.1.7.3) + actioncable (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.3) - actionpack (= 6.1.7.3) - activejob (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + actionmailbox (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (>= 2.7.1) - actionmailer (6.1.7.3) - actionpack (= 6.1.7.3) - actionview (= 6.1.7.3) - activejob (= 6.1.7.3) - activesupport (= 6.1.7.3) + actionmailer (6.1.7.6) + actionpack (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.3) - actionview (= 6.1.7.3) - activesupport (= 6.1.7.3) + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.3) - actionpack (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + actiontext (6.1.7.6) + actionpack (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) nokogiri (>= 1.8.5) - actionview (6.1.7.3) - activesupport (= 6.1.7.3) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.3) - activesupport (= 6.1.7.3) + activejob (6.1.7.6) + activesupport (= 6.1.7.6) globalid (>= 0.3.6) - activemodel (6.1.7.3) - activesupport (= 6.1.7.3) - activerecord (6.1.7.3) - activemodel (= 6.1.7.3) - activesupport (= 6.1.7.3) - activestorage (6.1.7.3) - actionpack (= 6.1.7.3) - activejob (= 6.1.7.3) - activerecord (= 6.1.7.3) - activesupport (= 6.1.7.3) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activerecord (6.1.7.6) + activemodel (= 6.1.7.6) + activesupport (= 6.1.7.6) + activestorage (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activesupport (= 6.1.7.6) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.3) + activesupport (6.1.7.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -81,17 +81,17 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) - lint_roller (1.0.0) - loofah (2.21.3) + lint_roller (1.1.0) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -101,65 +101,66 @@ GEM net-smtp marcel (1.0.2) method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.18.0) - net-imap (0.3.6) + mini_mime (1.1.5) + minitest (5.20.0) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.2-arm64-darwin) + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc - racc (1.7.1) - rack (2.2.7) + racc (1.7.3) + rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.3) - actioncable (= 6.1.7.3) - actionmailbox (= 6.1.7.3) - actionmailer (= 6.1.7.3) - actionpack (= 6.1.7.3) - actiontext (= 6.1.7.3) - actionview (= 6.1.7.3) - activejob (= 6.1.7.3) - activemodel (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + rails (6.1.7.6) + actioncable (= 6.1.7.6) + actionmailbox (= 6.1.7.6) + actionmailer (= 6.1.7.6) + actionpack (= 6.1.7.6) + actiontext (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activemodel (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) bundler (>= 1.15.0) - railties (= 6.1.7.3) + railties (= 6.1.7.6) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (6.1.7.3) - actionpack (= 6.1.7.3) - activesupport (= 6.1.7.3) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) method_source rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) - redis-client (0.14.1) + rake (13.1.0) + redis-client (0.18.0) connection_pool - regexp_parser (2.8.1) - rexml (3.2.5) + regexp_parser (2.8.3) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -169,10 +170,10 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -180,58 +181,60 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.0) - rubocop (1.52.1) + rspec-support (3.12.1) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - sidekiq (7.1.2) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.3-arm64-darwin) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - standard (1.29.0) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.57.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) - standard-custom (1.0.1) - lint_roller (~> 1.0) - standard-performance (1.1.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) lint_roller (~> 1.0) - rubocop-performance (~> 1.18.0) - thor (1.2.2) - timeout (0.3.2) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + thor (1.3.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.8) + zeitwerk (2.6.12) PLATFORMS arm64-darwin-22 @@ -244,7 +247,7 @@ DEPENDENCIES acts_as_tenant! appraisal! byebug - rails (~> 6.1.0, >= 6.1.4.1) + rails (~> 6.1.0) rspec (>= 3.0) rspec-rails sidekiq (~> 7.0) @@ -252,4 +255,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.4.3 + 2.4.22 diff --git a/gemfiles/rails_7.gemfile b/gemfiles/rails_7.gemfile index 195c1478..4abdef64 100644 --- a/gemfiles/rails_7.gemfile +++ b/gemfiles/rails_7.gemfile @@ -9,6 +9,6 @@ gem "standard" gem "sidekiq", "~> 7.0" gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" gem "byebug", group: [:development, :test] -gem "rails", "~> 7.0.0", ">= 7.0.0" +gem "rails", "~> 7.0.0" gemspec path: "../" diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index c52a8c6f..249dee4e 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/thoughtbot/appraisal.git - revision: b200e636903700098bef25f4f51dbc4c46e4c04c + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a specs: - appraisal (2.4.1) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -16,67 +16,67 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.5) - actionpack (= 7.0.5) - activesupport (= 7.0.5) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.5) - actionpack (= 7.0.5) - activejob (= 7.0.5) - activerecord (= 7.0.5) - activestorage (= 7.0.5) - activesupport (= 7.0.5) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.5) - actionpack (= 7.0.5) - actionview (= 7.0.5) - activejob (= 7.0.5) - activesupport (= 7.0.5) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.5) - actionview (= 7.0.5) - activesupport (= 7.0.5) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.5) - actionpack (= 7.0.5) - activerecord (= 7.0.5) - activestorage (= 7.0.5) - activesupport (= 7.0.5) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.5) - activesupport (= 7.0.5) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.5) - activesupport (= 7.0.5) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.5) - activesupport (= 7.0.5) - activerecord (7.0.5) - activemodel (= 7.0.5) - activesupport (= 7.0.5) - activestorage (7.0.5) - actionpack (= 7.0.5) - activejob (= 7.0.5) - activerecord (= 7.0.5) - activesupport (= 7.0.5) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.5) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -87,17 +87,17 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) - lint_roller (1.0.0) - loofah (2.21.3) + lint_roller (1.1.0) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -107,67 +107,68 @@ GEM net-smtp marcel (1.0.2) method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.18.0) - net-imap (0.3.6) + mini_mime (1.1.5) + mini_portile2 (2.8.5) + minitest (5.20.0) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.2) + nio4r (2.7.0) + nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc - racc (1.7.1) - rack (2.2.7) + racc (1.7.3) + rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.5) - actioncable (= 7.0.5) - actionmailbox (= 7.0.5) - actionmailer (= 7.0.5) - actionpack (= 7.0.5) - actiontext (= 7.0.5) - actionview (= 7.0.5) - activejob (= 7.0.5) - activemodel (= 7.0.5) - activerecord (= 7.0.5) - activestorage (= 7.0.5) - activesupport (= 7.0.5) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.5) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.0.8) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.5) - actionpack (= 7.0.5) - activesupport (= 7.0.5) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.0.6) - redis-client (0.14.1) + rake (13.1.0) + redis-client (0.18.0) connection_pool - regexp_parser (2.8.1) - rexml (3.2.5) + regexp_parser (2.8.3) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -177,10 +178,10 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -188,52 +189,54 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.0) - rubocop (1.52.1) + rspec-support (3.12.1) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - sidekiq (7.1.2) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - sqlite3 (1.6.3) + sqlite3 (1.6.9) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - standard (1.29.0) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.57.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) - standard-custom (1.0.1) - lint_roller (~> 1.0) - standard-performance (1.1.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) lint_roller (~> 1.0) - rubocop-performance (~> 1.18.0) - thor (1.2.2) - timeout (0.3.2) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + thor (1.3.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.8) + zeitwerk (2.6.12) PLATFORMS ruby @@ -244,7 +247,7 @@ DEPENDENCIES acts_as_tenant! appraisal! byebug - rails (~> 7.0.0, >= 7.0.0) + rails (~> 7.0.0) rspec (>= 3.0) rspec-rails sidekiq (~> 7.0) @@ -252,4 +255,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.4.3 + 2.4.22 diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile new file mode 100644 index 00000000..2fbcc769 --- /dev/null +++ b/gemfiles/rails_7_1.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3" +gem "standard" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" +gem "byebug", group: [:development, :test] +gem "rails", "~> 7.1.0" + +gemspec path: "../" diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock new file mode 100644 index 00000000..94f44b05 --- /dev/null +++ b/gemfiles/rails_7_1.gemfile.lock @@ -0,0 +1,287 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a + specs: + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + +PATH + remote: .. + specs: + acts_as_tenant (0.6.1) + rails (>= 5.2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.2) + activesupport (= 7.1.2) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.2) + activesupport (= 7.1.2) + globalid (>= 0.3.6) + activemodel (7.1.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) + timeout (>= 0.4.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) + marcel (~> 1.0) + activesupport (7.1.2) + base64 + bigdecimal + 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) + bigdecimal (3.1.4) + builder (3.2.4) + byebug (11.1.3) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + crass (1.0.6) + date (3.3.4) + diff-lcs (1.5.0) + drb (2.2.0) + ruby2_keywords + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + io-console (0.6.0) + irb (1.10.1) + rdoc + reline (>= 0.3.8) + json (2.7.1) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) + 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.2) + mini_mime (1.1.5) + minitest (5.20.0) + mutex_m (0.2.0) + net-imap (0.4.7) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0) + net-protocol + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-linux) + racc (~> 1.4) + parallel (1.23.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + psych (5.1.1.1) + stringio + racc (1.7.3) + rack (3.0.8) + 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.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) + bundler (>= 1.15.0) + railties (= 7.1.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.1.0) + rdoc (6.6.1) + psych (>= 4.0.0) + redis-client (0.18.0) + connection_pool + regexp_parser (2.8.3) + reline (0.4.1) + io-console (~> 0.5) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-rails (6.1.0) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) + rubocop (1.57.2) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sidekiq (7.2.0) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.57.2) + standard-custom (~> 1.0.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + webrick (1.8.1) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.12) + +PLATFORMS + arm64-darwin-22 + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + acts_as_tenant! + appraisal! + byebug + rails (~> 7.1.0) + rspec (>= 3.0) + rspec-rails + sidekiq (~> 7.0) + sqlite3 + standard + +BUNDLED WITH + 2.4.22 diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index d205e266..a519180b 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -1,93 +1,98 @@ GIT remote: https://github.com/rails/rails.git - revision: 87ab32f72a494ea18a4e2335becaebb66f5ce673 + revision: c1489a8ca4a9b91e21725f6a139e82e803c9eaa6 branch: main specs: - actioncable (7.1.0.alpha) - actionpack (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + actioncable (7.2.0.alpha) + actionpack (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.0.alpha) - actionpack (= 7.1.0.alpha) - activejob (= 7.1.0.alpha) - activerecord (= 7.1.0.alpha) - activestorage (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + actionmailbox (7.2.0.alpha) + actionpack (= 7.2.0.alpha) + activejob (= 7.2.0.alpha) + activerecord (= 7.2.0.alpha) + activestorage (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.0.alpha) - actionpack (= 7.1.0.alpha) - actionview (= 7.1.0.alpha) - activejob (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + actionmailer (7.2.0.alpha) + actionpack (= 7.2.0.alpha) + actionview (= 7.2.0.alpha) + activejob (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.1.0.alpha) - actionview (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + rails-dom-testing (~> 2.2) + actionpack (7.2.0.alpha) + actionview (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) nokogiri (>= 1.8.5) + racc rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) + rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.0.alpha) - actionpack (= 7.1.0.alpha) - activerecord (= 7.1.0.alpha) - activestorage (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + actiontext (7.2.0.alpha) + actionpack (= 7.2.0.alpha) + activerecord (= 7.2.0.alpha) + activestorage (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.0.alpha) - activesupport (= 7.1.0.alpha) + actionview (7.2.0.alpha) + activesupport (= 7.2.0.alpha) builder (~> 3.1) erubi (~> 1.11) - rails-dom-testing (~> 2.0) + rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.0.alpha) - activesupport (= 7.1.0.alpha) + activejob (7.2.0.alpha) + activesupport (= 7.2.0.alpha) globalid (>= 0.3.6) - activemodel (7.1.0.alpha) - activesupport (= 7.1.0.alpha) - activerecord (7.1.0.alpha) - activemodel (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) - activestorage (7.1.0.alpha) - actionpack (= 7.1.0.alpha) - activejob (= 7.1.0.alpha) - activerecord (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + activemodel (7.2.0.alpha) + activesupport (= 7.2.0.alpha) + activerecord (7.2.0.alpha) + activemodel (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) + timeout (>= 0.4.0) + activestorage (7.2.0.alpha) + actionpack (= 7.2.0.alpha) + activejob (= 7.2.0.alpha) + activerecord (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) marcel (~> 1.0) - activesupport (7.1.0.alpha) + activesupport (7.2.0.alpha) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) - tzinfo (~> 2.0) - rails (7.1.0.alpha) - actioncable (= 7.1.0.alpha) - actionmailbox (= 7.1.0.alpha) - actionmailer (= 7.1.0.alpha) - actionpack (= 7.1.0.alpha) - actiontext (= 7.1.0.alpha) - actionview (= 7.1.0.alpha) - activejob (= 7.1.0.alpha) - activemodel (= 7.1.0.alpha) - activerecord (= 7.1.0.alpha) - activestorage (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + tzinfo (~> 2.0, >= 2.0.5) + rails (7.2.0.alpha) + actioncable (= 7.2.0.alpha) + actionmailbox (= 7.2.0.alpha) + actionmailer (= 7.2.0.alpha) + actionpack (= 7.2.0.alpha) + actiontext (= 7.2.0.alpha) + actionview (= 7.2.0.alpha) + activejob (= 7.2.0.alpha) + activemodel (= 7.2.0.alpha) + activerecord (= 7.2.0.alpha) + activestorage (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) bundler (>= 1.15.0) - railties (= 7.1.0.alpha) - railties (7.1.0.alpha) - actionpack (= 7.1.0.alpha) - activesupport (= 7.1.0.alpha) + railties (= 7.2.0.alpha) + railties (7.2.0.alpha) + actionpack (= 7.2.0.alpha) + activesupport (= 7.2.0.alpha) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -96,7 +101,7 @@ GIT GIT remote: https://github.com/rspec/rspec-core.git - revision: 8caecca0b9b299ccbaa5c7ea5dd885ab42cd57d3 + revision: f273314f575ab62092b2ad86addb6a3c93d6041f branch: main specs: rspec-core (3.13.0.pre) @@ -104,7 +109,7 @@ GIT GIT remote: https://github.com/rspec/rspec-expectations.git - revision: 8a468eea0a2ee456db4d6e2dccccd66ff269b862 + revision: 2e8e800a0d8b64e7168dd625efe8f7526b7f1262 branch: main specs: rspec-expectations (3.13.0.pre) @@ -113,7 +118,7 @@ GIT GIT remote: https://github.com/rspec/rspec-mocks.git - revision: 0d22620149a66d38ed03f60e96045721d71ce134 + revision: 868bf98d2aae5f0db15441a41b86b5f9346a12dd branch: main specs: rspec-mocks (3.13.0.pre) @@ -122,10 +127,10 @@ GIT GIT remote: https://github.com/rspec/rspec-rails.git - revision: ce4b5264ebb7ba7fb7a794782e334332faa33a20 + revision: d8d1e5ab49fc997dacc503888fe4f459f47649e0 branch: main specs: - rspec-rails (6.1.0.pre) + rspec-rails (6.2.0.pre) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -136,7 +141,7 @@ GIT GIT remote: https://github.com/rspec/rspec-support.git - revision: 6d33eaa48a761d616e23b81fc33b68a6e68ec296 + revision: 48c227f93d7b69ce28babb2dce0a9d08ac4d2654 branch: main specs: rspec-support (3.13.0.pre) @@ -153,9 +158,9 @@ GIT GIT remote: https://github.com/thoughtbot/appraisal.git - revision: b200e636903700098bef25f4f51dbc4c46e4c04c + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a specs: - appraisal (2.4.1) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -170,25 +175,30 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.4) builder (3.2.4) byebug (11.1.3) concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) + drb (2.2.0) + ruby2_keywords erubi (1.12.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) io-console (0.6.0) - irb (1.7.0) - reline (>= 0.3.0) - json (2.6.3) + irb (1.10.1) + rdoc + reline (>= 0.3.8) + json (2.7.1) language_server-protocol (3.17.0.3) - lint_roller (1.0.0) - loofah (2.21.3) + lint_roller (1.1.0) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -197,31 +207,33 @@ GEM net-pop net-smtp marcel (1.0.2) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.18.0) - net-imap (0.3.6) + mini_mime (1.1.5) + mini_portile2 (2.8.5) + minitest (5.20.0) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.2) + nio4r (2.7.0) + nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc - racc (1.7.1) + psych (5.1.1.1) + stringio + racc (1.7.3) rack (3.0.8) rack-session (2.0.0) rack (>= 3.0.0) @@ -230,66 +242,73 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) rainbow (3.1.1) - rake (13.0.6) - redis-client (0.14.1) + rake (13.1.0) + rdoc (6.6.1) + psych (>= 4.0.0) + redis-client (0.18.0) connection_pool - regexp_parser (2.8.1) - reline (0.3.5) + regexp_parser (2.8.3) + reline (0.4.1) io-console (~> 0.5) - rexml (3.2.5) - rubocop (1.52.1) + rexml (3.2.6) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - sidekiq (7.1.2) + ruby2_keywords (0.0.5) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - sqlite3 (1.6.3) + sqlite3 (1.6.9) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - standard (1.29.0) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.57.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) - standard-custom (1.0.1) - lint_roller (~> 1.0) - standard-performance (1.1.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) lint_roller (~> 1.0) - rubocop-performance (~> 1.18.0) - thor (1.2.2) - timeout (0.3.2) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) webrick (1.8.1) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.8) + zeitwerk (2.6.12) PLATFORMS ruby @@ -312,4 +331,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.4.3 + 2.4.22 diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock index b11da8f8..1b768e1b 100644 --- a/gemfiles/sidekiq_6.gemfile.lock +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/thoughtbot/appraisal.git - revision: b200e636903700098bef25f4f51dbc4c46e4c04c + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a specs: - appraisal (2.4.1) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -16,88 +16,105 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.5) - actionpack (= 7.0.5) - activesupport (= 7.0.5) + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.5) - actionpack (= 7.0.5) - activejob (= 7.0.5) - activerecord (= 7.0.5) - activestorage (= 7.0.5) - activesupport (= 7.0.5) + zeitwerk (~> 2.6) + actionmailbox (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.5) - actionpack (= 7.0.5) - actionview (= 7.0.5) - activejob (= 7.0.5) - activesupport (= 7.0.5) + actionmailer (7.1.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.5) - actionview (= 7.0.5) - activesupport (= 7.0.5) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + racc + 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.5) - actionpack (= 7.0.5) - activerecord (= 7.0.5) - activestorage (= 7.0.5) - activesupport (= 7.0.5) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.5) - activesupport (= 7.0.5) + actionview (7.1.2) + activesupport (= 7.1.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.5) - activesupport (= 7.0.5) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.2) + activesupport (= 7.1.2) globalid (>= 0.3.6) - activemodel (7.0.5) - activesupport (= 7.0.5) - activerecord (7.0.5) - activemodel (= 7.0.5) - activesupport (= 7.0.5) - activestorage (7.0.5) - actionpack (= 7.0.5) - activejob (= 7.0.5) - activerecord (= 7.0.5) - activesupport (= 7.0.5) + activemodel (7.1.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) + timeout (>= 0.4.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.5) + activesupport (7.1.2) + base64 + bigdecimal 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) + bigdecimal (3.1.4) builder (3.2.4) byebug (11.1.3) concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) + drb (2.2.0) + ruby2_keywords erubi (1.12.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.3) + io-console (0.6.0) + irb (1.10.1) + rdoc + reline (>= 0.3.8) + json (2.7.1) language_server-protocol (3.17.0.3) - lint_roller (1.0.0) - loofah (2.21.3) + lint_roller (1.1.0) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -106,65 +123,78 @@ GEM net-pop net-smtp marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.18.0) - net-imap (0.3.6) + mini_mime (1.1.5) + minitest (5.20.0) + mutex_m (0.2.0) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.2-arm64-darwin) + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc - racc (1.7.1) - rack (2.2.7) + psych (5.1.1.1) + stringio + racc (1.7.3) + rack (2.2.8) + rack-session (1.0.2) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.5) - actioncable (= 7.0.5) - actionmailbox (= 7.0.5) - actionmailer (= 7.0.5) - actionpack (= 7.0.5) - actiontext (= 7.0.5) - actionview (= 7.0.5) - activejob (= 7.0.5) - activemodel (= 7.0.5) - activerecord (= 7.0.5) - activestorage (= 7.0.5) - activesupport (= 7.0.5) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) bundler (>= 1.15.0) - railties (= 7.0.5) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.1.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.5) - actionpack (= 7.0.5) - activesupport (= 7.0.5) - method_source + railties (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) + rdoc (6.6.1) + psych (>= 4.0.0) redis (4.8.1) - regexp_parser (2.8.1) - rexml (3.2.5) + regexp_parser (2.8.3) + reline (0.4.1) + io-console (~> 0.5) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -174,10 +204,10 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -185,50 +215,55 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.0) - rubocop (1.52.1) + rspec-support (3.12.1) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - sidekiq (6.5.9) + ruby2_keywords (0.0.5) + sidekiq (6.5.12) connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sqlite3 (1.6.3-arm64-darwin) - sqlite3 (1.6.3-x86_64-darwin) - sqlite3 (1.6.3-x86_64-linux) - standard (1.29.0) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.57.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) - standard-custom (1.0.1) - lint_roller (~> 1.0) - standard-performance (1.1.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) lint_roller (~> 1.0) - rubocop-performance (~> 1.18.0) - thor (1.2.2) - timeout (0.3.2) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + webrick (1.8.1) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.8) + zeitwerk (2.6.12) PLATFORMS arm64-darwin-22 @@ -246,4 +281,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.3.26 + 2.4.22 diff --git a/gemfiles/sidekiq_7.gemfile b/gemfiles/sidekiq_7.gemfile new file mode 100644 index 00000000..bc4d7e86 --- /dev/null +++ b/gemfiles/sidekiq_7.gemfile @@ -0,0 +1,13 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rspec", ">=3.0" +gem "rspec-rails" +gem "sqlite3" +gem "standard" +gem "sidekiq", "~> 7.0" +gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" +gem "byebug", group: [:development, :test] + +gemspec path: "../" diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock new file mode 100644 index 00000000..09d71a8b --- /dev/null +++ b/gemfiles/sidekiq_7.gemfile.lock @@ -0,0 +1,286 @@ +GIT + remote: https://github.com/thoughtbot/appraisal.git + revision: feb78bcc6177038399bff098cb6c2bd4bca4972a + specs: + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + +PATH + remote: .. + specs: + acts_as_tenant (0.6.1) + rails (>= 5.2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.2) + activesupport (= 7.1.2) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.2) + activesupport (= 7.1.2) + globalid (>= 0.3.6) + activemodel (7.1.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) + timeout (>= 0.4.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) + marcel (~> 1.0) + activesupport (7.1.2) + base64 + bigdecimal + 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) + bigdecimal (3.1.4) + builder (3.2.4) + byebug (11.1.3) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + crass (1.0.6) + date (3.3.4) + diff-lcs (1.5.0) + drb (2.2.0) + ruby2_keywords + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + io-console (0.6.0) + irb (1.10.1) + rdoc + reline (>= 0.3.8) + json (2.7.1) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) + 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.2) + mini_mime (1.1.5) + minitest (5.20.0) + mutex_m (0.2.0) + net-imap (0.4.7) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0) + net-protocol + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-linux) + racc (~> 1.4) + parallel (1.23.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + psych (5.1.1.1) + stringio + racc (1.7.3) + rack (3.0.8) + 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.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) + bundler (>= 1.15.0) + railties (= 7.1.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.1.0) + rdoc (6.6.1) + psych (>= 4.0.0) + redis-client (0.18.0) + connection_pool + regexp_parser (2.8.3) + reline (0.4.1) + io-console (~> 0.5) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-rails (6.1.0) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) + rubocop (1.57.2) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sidekiq (7.2.0) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.14.0) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-darwin) + sqlite3 (1.6.9-x86_64-linux) + standard (1.32.1) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.57.2) + standard-custom (~> 1.0.0) + standard-performance (~> 1.2) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.2.1) + lint_roller (~> 1.1) + rubocop-performance (~> 1.19.1) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + webrick (1.8.1) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.12) + +PLATFORMS + arm64-darwin-22 + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + acts_as_tenant! + appraisal! + byebug + rspec (>= 3.0) + rspec-rails + sidekiq (~> 7.0) + sqlite3 + standard + +BUNDLED WITH + 2.4.22 From 44a5b7c6224131869bff0fe5ab92980ed72b31d3 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 19:56:27 -0600 Subject: [PATCH 19/31] Drop Rails 5.2 support --- .github/workflows/ci.yml | 7 - Appraisals | 4 - CHANGELOG.md | 1 + README.md | 12 +- acts_as_tenant.gemspec | 2 +- gemfiles/rails_5.gemfile | 14 -- gemfiles/rails_5.gemfile.lock | 239 ---------------------------- lib/acts_as_tenant.rb | 1 - spec/acts_as_tenant/sidekiq_spec.rb | 1 + 9 files changed, 12 insertions(+), 269 deletions(-) delete mode 100644 gemfiles/rails_5.gemfile delete mode 100644 gemfiles/rails_5.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86d12c07..081e91fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,6 @@ jobs: matrix: ruby: ['2.7', '3.0', '3.1', '3.2'] gemfile: - - rails_5 - rails_6 - rails_6_1 - rails_7 @@ -25,12 +24,6 @@ jobs: - sidekiq_6 - sidekiq_7 exclude: - - ruby: '3.0' - gemfile: rails_5 - - ruby: '3.1' - gemfile: rails_5 - - ruby: '3.2' - gemfile: rails_5 - ruby: '3.2' gemfile: rails_6 diff --git a/Appraisals b/Appraisals index 376fcbbd..86c3ce8f 100644 --- a/Appraisals +++ b/Appraisals @@ -1,7 +1,3 @@ -appraise "rails-5" do - gem "rails", "~> 5.2.0" -end - appraise "rails-6" do gem "rails", "~> 6.0.0" end diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c0fa63..965956b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Unreleased ---------- +* [Breaking] Drop Rails 5.2 support * Replace RequestStore dependency with CurrentAttributes. #313 - @excid3 * Easy integration with Sidekiq, not requiring to add any configuration to the initializer #314 - @nunommc * Add `scope` support to `acts_as_tenant :account, ->{ with_deleted }` #282 - @adrian-gomez diff --git a/README.md b/README.md index 68816689..b51d9171 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ Want to see how it works? Check out [the ActsAsTenant walkthrough video](https:/ Installation ------------ -acts_as_tenant will only work on Rails 5.2 and up. This is due to changes made to the handling of `default_scope`, an essential pillar of the gem. - To use it, add it to your Gemfile: ```ruby @@ -325,7 +323,15 @@ Background Processing libraries ActsAsTenant supports -- [Sidekiq](//sidekiq.org/) - make sure to place acts_as_tenant gem after sidekiq in your gemfiles; +- ActiveJob - ActsAsTenant will automatically save the current tenant in ActiveJob arguments and set it when the job runs. + +- [Sidekiq](//sidekiq.org/) +Add the following code to `config/initializers/acts_as_tenant.rb`: + +```ruby +require 'acts_as_tenant/sidekiq' +``` + - DelayedJob - [acts_as_tenant-delayed_job](https://github.com/nunommc/acts_as_tenant-delayed_job) Testing diff --git a/acts_as_tenant.gemspec b/acts_as_tenant.gemspec index 784f9e9a..94180725 100644 --- a/acts_as_tenant.gemspec +++ b/acts_as_tenant.gemspec @@ -14,5 +14,5 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] - spec.add_dependency "rails", ">= 5.2" + spec.add_dependency "rails", ">= 6.0" end diff --git a/gemfiles/rails_5.gemfile b/gemfiles/rails_5.gemfile deleted file mode 100644 index 3689cdae..00000000 --- a/gemfiles/rails_5.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rspec", ">=3.0" -gem "rspec-rails" -gem "sqlite3" -gem "standard" -gem "sidekiq", "~> 7.0" -gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git" -gem "byebug", group: [:development, :test] -gem "rails", "~> 5.2.0" - -gemspec path: "../" diff --git a/gemfiles/rails_5.gemfile.lock b/gemfiles/rails_5.gemfile.lock deleted file mode 100644 index 8428415b..00000000 --- a/gemfiles/rails_5.gemfile.lock +++ /dev/null @@ -1,239 +0,0 @@ -GIT - remote: https://github.com/thoughtbot/appraisal.git - revision: feb78bcc6177038399bff098cb6c2bd4bca4972a - specs: - appraisal (2.5.0) - bundler - rake - thor (>= 0.14.0) - -PATH - remote: .. - specs: - acts_as_tenant (0.6.1) - rails (>= 5.2) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.2.8.1) - actionpack (= 5.2.8.1) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailer (5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.8.1) - actionview (= 5.2.8.1) - activesupport (= 5.2.8.1) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8.1) - activesupport (= 5.2.8.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.8.1) - activesupport (= 5.2.8.1) - globalid (>= 0.3.6) - activemodel (5.2.8.1) - activesupport (= 5.2.8.1) - activerecord (5.2.8.1) - activemodel (= 5.2.8.1) - activesupport (= 5.2.8.1) - arel (>= 9.0) - activestorage (5.2.8.1) - actionpack (= 5.2.8.1) - activerecord (= 5.2.8.1) - marcel (~> 1.0.0) - activesupport (5.2.8.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) - ast (2.4.2) - builder (3.2.4) - byebug (11.1.3) - concurrent-ruby (1.2.2) - connection_pool (2.4.1) - crass (1.0.6) - date (3.3.4) - diff-lcs (1.5.0) - erubi (1.12.0) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - json (2.7.1) - language_server-protocol (3.17.0.3) - lint_roller (1.1.0) - 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.2) - method_source (1.0.0) - mini_mime (1.1.5) - minitest (5.20.0) - net-imap (0.4.7) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.4.0) - net-protocol - nio4r (2.7.0) - nokogiri (1.15.5-arm64-darwin) - racc (~> 1.4) - nokogiri (1.15.5-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.15.5-x86_64-linux) - racc (~> 1.4) - parallel (1.23.0) - parser (3.2.2.4) - ast (~> 2.4.1) - racc - racc (1.7.3) - rack (2.2.8) - rack-test (2.1.0) - rack (>= 1.3) - rails (5.2.8.1) - actioncable (= 5.2.8.1) - actionmailer (= 5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - activemodel (= 5.2.8.1) - activerecord (= 5.2.8.1) - activestorage (= 5.2.8.1) - activesupport (= 5.2.8.1) - bundler (>= 1.3.0) - railties (= 5.2.8.1) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.2.0) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (5.2.8.1) - actionpack (= 5.2.8.1) - activesupport (= 5.2.8.1) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rainbow (3.1.1) - rake (13.1.0) - redis-client (0.18.0) - connection_pool - regexp_parser (2.8.3) - rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.1) - rubocop (1.57.2) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.2.2.4) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - ruby-progressbar (1.13.0) - sidekiq (7.2.0) - concurrent-ruby (< 2) - connection_pool (>= 2.3.0) - rack (>= 2.2.4) - redis-client (>= 0.14.0) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - sqlite3 (1.6.9-arm64-darwin) - sqlite3 (1.6.9-x86_64-darwin) - sqlite3 (1.6.9-x86_64-linux) - standard (1.32.1) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.57.2) - standard-custom (~> 1.0.0) - standard-performance (~> 1.2) - standard-custom (1.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.50) - standard-performance (1.2.1) - lint_roller (~> 1.1) - rubocop-performance (~> 1.19.1) - thor (1.3.0) - thread_safe (0.3.6) - timeout (0.4.1) - tzinfo (1.2.11) - thread_safe (~> 0.1) - unicode-display_width (2.5.0) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - -PLATFORMS - arm64-darwin-22 - x86_64-darwin-20 - x86_64-darwin-21 - x86_64-darwin-22 - x86_64-linux - -DEPENDENCIES - acts_as_tenant! - appraisal! - byebug - rails (~> 5.2.0) - rspec (>= 3.0) - rspec-rails - sidekiq (~> 7.0) - sqlite3 - standard - -BUNDLED WITH - 2.4.22 diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index 5ab99ad6..20bd25bb 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -151,7 +151,6 @@ def self.should_require_tenant? ActiveSupport.on_load(:active_record) do |base| base.include ActsAsTenant::ModelExtensions - require "acts_as_tenant/sidekiq" if defined?(::Sidekiq) end ActiveSupport.on_load(:action_controller) do |base| diff --git a/spec/acts_as_tenant/sidekiq_spec.rb b/spec/acts_as_tenant/sidekiq_spec.rb index b5b150fc..b7f5bdcd 100644 --- a/spec/acts_as_tenant/sidekiq_spec.rb +++ b/spec/acts_as_tenant/sidekiq_spec.rb @@ -1,4 +1,5 @@ require "spec_helper" +require "acts_as_tenant/sidekiq" describe "ActsAsTenant::Sidekiq" do let(:account) { Account.new(id: 1234) } From 1f5431ef42612b582d32f281d545ed01797e3267 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 19:59:40 -0600 Subject: [PATCH 20/31] Update gemfiles --- gemfiles/rails_6.gemfile.lock | 2 +- gemfiles/rails_6_1.gemfile.lock | 2 +- gemfiles/rails_7.gemfile.lock | 2 +- gemfiles/rails_7_1.gemfile.lock | 2 +- gemfiles/rails_main.gemfile.lock | 2 +- gemfiles/sidekiq_6.gemfile.lock | 2 +- gemfiles/sidekiq_7.gemfile.lock | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 67c8b6cc..7991c894 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index 11638f27..537179e9 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index 249dee4e..9cb3edc4 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 94f44b05..7101b202 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index a519180b..1a5c4c6e 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -169,7 +169,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock index 1b768e1b..35d62a48 100644 --- a/gemfiles/sidekiq_6.gemfile.lock +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock index 09d71a8b..08d5aa87 100644 --- a/gemfiles/sidekiq_7.gemfile.lock +++ b/gemfiles/sidekiq_7.gemfile.lock @@ -11,7 +11,7 @@ PATH remote: .. specs: acts_as_tenant (0.6.1) - rails (>= 5.2) + rails (>= 6.0) GEM remote: https://rubygems.org/ From 4f936e27e459d4ae835ca9dc59481ee5559d17ad Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 20:05:18 -0600 Subject: [PATCH 21/31] Version bump --- CHANGELOG.md | 3 +++ gemfiles/rails_6.gemfile.lock | 2 +- gemfiles/rails_6_1.gemfile.lock | 2 +- gemfiles/rails_7.gemfile.lock | 2 +- gemfiles/rails_7_1.gemfile.lock | 2 +- gemfiles/rails_main.gemfile.lock | 2 +- gemfiles/sidekiq_6.gemfile.lock | 2 +- gemfiles/sidekiq_7.gemfile.lock | 2 +- lib/acts_as_tenant/version.rb | 2 +- 9 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 965956b3..96208ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Unreleased ---------- +1.0.0 +----- + * [Breaking] Drop Rails 5.2 support * Replace RequestStore dependency with CurrentAttributes. #313 - @excid3 * Easy integration with Sidekiq, not requiring to add any configuration to the initializer #314 - @nunommc diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 7991c894..fce81609 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index 537179e9..ac3ec89d 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index 9cb3edc4..2f6f881d 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 7101b202..7f384ba8 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index 1a5c4c6e..17982379 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -168,7 +168,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock index 35d62a48..7e275427 100644 --- a/gemfiles/sidekiq_6.gemfile.lock +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock index 08d5aa87..479ad7b7 100644 --- a/gemfiles/sidekiq_7.gemfile.lock +++ b/gemfiles/sidekiq_7.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (0.6.1) + acts_as_tenant (1.0.0) rails (>= 6.0) GEM diff --git a/lib/acts_as_tenant/version.rb b/lib/acts_as_tenant/version.rb index 0e512a80..b6f79225 100644 --- a/lib/acts_as_tenant/version.rb +++ b/lib/acts_as_tenant/version.rb @@ -1,3 +1,3 @@ module ActsAsTenant - VERSION = "0.6.1" + VERSION = "1.0.0" end From 0c4130e03f0510fa4a51fa78390b660e8608f64d Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 6 Dec 2023 20:08:45 -0600 Subject: [PATCH 22/31] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96208ee7..31e1fee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,8 @@ Unreleased ----- * [Breaking] Drop Rails 5.2 support +* Set current_tenant with ActiveJob automatically #319 * Replace RequestStore dependency with CurrentAttributes. #313 - @excid3 -* Easy integration with Sidekiq, not requiring to add any configuration to the initializer #314 - @nunommc * Add `scope` support to `acts_as_tenant :account, ->{ with_deleted }` #282 - @adrian-gomez The scope will be forwarded to `belongs_to`. * Add `job_scope` configuration to customize how tenants are loaded in background jobs - @excid3 From 572469db21b650074e54d4dec019491a74684d71 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 7 Dec 2023 08:20:55 -0600 Subject: [PATCH 23/31] Add mailer preview example --- spec/dummy/app/mailers/user_mailer.rb | 4 ++++ spec/dummy/app/views/user_mailer/welcome_email.html.erb | 1 + spec/dummy/db/schema.rb | 1 + spec/dummy/test/mailers/previews/user_mailer_preview.rb | 7 +++++++ spec/fixtures/users.yml | 5 ++++- 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 spec/dummy/app/views/user_mailer/welcome_email.html.erb create mode 100644 spec/dummy/test/mailers/previews/user_mailer_preview.rb diff --git a/spec/dummy/app/mailers/user_mailer.rb b/spec/dummy/app/mailers/user_mailer.rb index cba5fb63..7b7eade0 100644 --- a/spec/dummy/app/mailers/user_mailer.rb +++ b/spec/dummy/app/mailers/user_mailer.rb @@ -2,4 +2,8 @@ class UserMailer < ApplicationMailer def comment_notification mail(body: "") end + + def welcome_email + mail to: params[:user].email + end end diff --git a/spec/dummy/app/views/user_mailer/welcome_email.html.erb b/spec/dummy/app/views/user_mailer/welcome_email.html.erb new file mode 100644 index 00000000..802992c4 --- /dev/null +++ b/spec/dummy/app/views/user_mailer/welcome_email.html.erb @@ -0,0 +1 @@ +Hello world diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 3ba91821..eb6ca205 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -86,6 +86,7 @@ end create_table :users, force: true do |t| + t.column :email, :string t.column :name, :string end diff --git a/spec/dummy/test/mailers/previews/user_mailer_preview.rb b/spec/dummy/test/mailers/previews/user_mailer_preview.rb new file mode 100644 index 00000000..4dc91bfb --- /dev/null +++ b/spec/dummy/test/mailers/previews/user_mailer_preview.rb @@ -0,0 +1,7 @@ +class UserMailerPreview < ActionMailer::Preview + def welcome_email + ActsAsTenant.with_tenant(Account.first) do + UserMailer.with(user: User.first).welcome_email + end + end +end diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 3caa9ed9..4a842ce1 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -1,8 +1,11 @@ john: + email: john@example.org name: john bob: + email: bob@example.org name: bob alice: - name: alice \ No newline at end of file + email: alice@example.org + name: alice From 5ef6d287e9ca1a12a24908cb137df902024e4f4c Mon Sep 17 00:00:00 2001 From: Ziad Sawalha Date: Wed, 13 Dec 2023 02:17:43 +0100 Subject: [PATCH 24/31] Serialize tenant to string instead of GlobalID (#326) Sidekiq best practices prefer JSON types and GlobalID::Locator.locate works with the string representation of GlobalID (which is a unique URI) Co-authored-by: Ziad Sawalha --- lib/acts_as_tenant/active_job_extensions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acts_as_tenant/active_job_extensions.rb b/lib/acts_as_tenant/active_job_extensions.rb index b9b5d967..a0e3b428 100644 --- a/lib/acts_as_tenant/active_job_extensions.rb +++ b/lib/acts_as_tenant/active_job_extensions.rb @@ -1,7 +1,7 @@ module ActsAsTenant module ActiveJobExtensions def serialize - super.merge("current_tenant" => ActsAsTenant.current_tenant&.to_global_id) + super.merge("current_tenant" => ActsAsTenant.current_tenant&.to_global_id&.to_s) end def deserialize(job_data) From 8e8f9de07df3d389da65f7f597346f157f163f67 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 14 Dec 2023 09:01:24 -0600 Subject: [PATCH 25/31] Version bump --- CHANGELOG.md | 5 +++++ gemfiles/rails_6.gemfile.lock | 2 +- gemfiles/rails_6_1.gemfile.lock | 2 +- gemfiles/rails_7.gemfile.lock | 2 +- gemfiles/rails_7_1.gemfile.lock | 2 +- gemfiles/rails_main.gemfile.lock | 2 +- gemfiles/sidekiq_6.gemfile.lock | 2 +- gemfiles/sidekiq_7.gemfile.lock | 2 +- lib/acts_as_tenant/version.rb | 2 +- 9 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e1fee4..da7cd295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Unreleased ---------- +1.0.1 +----- + +* Cast GID to string for job args #326 + 1.0.0 ----- diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index fce81609..9397f5d5 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index ac3ec89d..fa140699 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index 2f6f881d..f4d12c0d 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 7f384ba8..6265e08d 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index 17982379..88df9ed5 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -168,7 +168,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock index 7e275427..ed638a12 100644 --- a/gemfiles/sidekiq_6.gemfile.lock +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock index 479ad7b7..8c74bd1f 100644 --- a/gemfiles/sidekiq_7.gemfile.lock +++ b/gemfiles/sidekiq_7.gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: .. specs: - acts_as_tenant (1.0.0) + acts_as_tenant (1.0.1) rails (>= 6.0) GEM diff --git a/lib/acts_as_tenant/version.rb b/lib/acts_as_tenant/version.rb index b6f79225..e65a3daa 100644 --- a/lib/acts_as_tenant/version.rb +++ b/lib/acts_as_tenant/version.rb @@ -1,3 +1,3 @@ module ActsAsTenant - VERSION = "1.0.0" + VERSION = "1.0.1" end From 599d8af0b4e52c0228806e901cb558901b2a356e Mon Sep 17 00:00:00 2001 From: Christopher Winslett Date: Wed, 10 Jan 2024 19:30:53 -0600 Subject: [PATCH 26/31] Add a tenant change hook (#333) * add a tenant change hook * cleanup syntax for standardrb --------- Co-authored-by: Christopher Winslett --- lib/acts_as_tenant.rb | 10 ++++++++ lib/acts_as_tenant/configuration.rb | 6 +++++ spec/acts_as_tenant/configuration_spec.rb | 28 +++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index 20bd25bb..f4074015 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -16,6 +16,16 @@ module ActsAsTenant class Current < ActiveSupport::CurrentAttributes attribute :current_tenant, :acts_as_tenant_unscoped + + def current_tenant=(tenant) + super.tap do + configuration.tenant_change_hook.call(tenant) if configuration.tenant_change_hook.present? + end + end + + def configuration + Module.nesting.last.class_variable_get(:@@configuration) + end end class << self diff --git a/lib/acts_as_tenant/configuration.rb b/lib/acts_as_tenant/configuration.rb index e75ebcfc..c18685c2 100644 --- a/lib/acts_as_tenant/configuration.rb +++ b/lib/acts_as_tenant/configuration.rb @@ -1,6 +1,7 @@ module ActsAsTenant class Configuration attr_writer :require_tenant, :pkey + attr_reader :tenant_change_hook def require_tenant @require_tenant ||= false @@ -27,5 +28,10 @@ def job_scope=(scope) scope end end + + def tenant_change_hook=(hook) + raise(ArgumentError, "tenant_change_hook must be a Proc") unless hook.is_a?(Proc) + @tenant_change_hook = hook + end end end diff --git a/spec/acts_as_tenant/configuration_spec.rb b/spec/acts_as_tenant/configuration_spec.rb index 9d1f33ac..c12edd4e 100644 --- a/spec/acts_as_tenant/configuration_spec.rb +++ b/spec/acts_as_tenant/configuration_spec.rb @@ -59,5 +59,33 @@ expect(ActsAsTenant.should_require_tenant?).to eq(false) end + + it "runs a hook on current_tenant" do + truthy = false + ActsAsTenant.configure do |config| + config.tenant_change_hook = lambda do |tenant| + truthy = true + end + end + + ActsAsTenant.current_tenant = "foobar" + + expect(truthy).to eq(true) + end + + it "runs a hook on with_tenant" do + truthy = false + ActsAsTenant.configure do |config| + config.tenant_change_hook = lambda do |tenant| + truthy = true + end + end + + ActsAsTenant.with_tenant("foobar") do + # do nothing + end + + expect(truthy).to eq(true) + end end end From 7e3bd8a534f309061a9c34b4ed3eb3576e2e065d Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 10 Jan 2024 19:32:33 -0600 Subject: [PATCH 27/31] Update CHANGELOG.md --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da7cd295..9ae8d19b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ Unreleased ---------- +* Add `config.tenant_change_hook` callback when a tenant changes. [#333](https://github.com/ErwinM/acts_as_tenant/pull/333) + +This can be used to implement Postgres's row-level security for example + +```ruby +ActsAsTenant.configure do |config| + config.tenant_change_hook = lambda do |tenant| + if tenant.present? + ActiveRecord::Base.connection.execute(ActiveRecord::Base.sanitize_sql_array(["SET rls.account_id = ?;", tenant.id])) + Rails.logger.info "Changed tenant to " + [tenant.id, tenant.name].to_json + end + end +end +``` + 1.0.1 ----- From 4228c9d4af864c156bae8f2aadfbb68b57d9fe61 Mon Sep 17 00:00:00 2001 From: Trevor John Date: Fri, 19 Jan 2024 17:30:21 -0500 Subject: [PATCH 28/31] Add Mac m2 platform to gemfiles --- gemfiles/rails_6.gemfile.lock | 1 + gemfiles/rails_6_1.gemfile.lock | 1 + gemfiles/rails_7.gemfile.lock | 4 ++++ gemfiles/rails_7_1.gemfile.lock | 1 + gemfiles/rails_main.gemfile.lock | 4 ++++ gemfiles/sidekiq_6.gemfile.lock | 1 + gemfiles/sidekiq_7.gemfile.lock | 1 + 7 files changed, 13 insertions(+) diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock index 9397f5d5..320f74ea 100644 --- a/gemfiles/rails_6.gemfile.lock +++ b/gemfiles/rails_6.gemfile.lock @@ -235,6 +235,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-20 x86_64-darwin-21 x86_64-darwin-22 diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index fa140699..351854fc 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -238,6 +238,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-20 x86_64-darwin-21 x86_64-darwin-22 diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index f4d12c0d..13f4acd8 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -123,6 +123,8 @@ GEM nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) + nokogiri (1.15.5-arm64-darwin) + racc (~> 1.4) nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) nokogiri (1.15.5-x86_64-linux) @@ -214,6 +216,7 @@ GEM redis-client (>= 0.14.0) sqlite3 (1.6.9) mini_portile2 (~> 2.8.0) + sqlite3 (1.6.9-arm64-darwin) sqlite3 (1.6.9-x86_64-darwin) sqlite3 (1.6.9-x86_64-linux) standard (1.32.1) @@ -239,6 +242,7 @@ GEM zeitwerk (2.6.12) PLATFORMS + arm64-darwin-23 ruby x86_64-darwin-21 x86_64-linux diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 6265e08d..ecb32cf3 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -269,6 +269,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-22 x86_64-linux diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index 88df9ed5..12d0bfbd 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -223,6 +223,8 @@ GEM nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) + nokogiri (1.15.5-arm64-darwin) + racc (~> 1.4) nokogiri (1.15.5-x86_64-darwin) racc (~> 1.4) nokogiri (1.15.5-x86_64-linux) @@ -284,6 +286,7 @@ GEM redis-client (>= 0.14.0) sqlite3 (1.6.9) mini_portile2 (~> 2.8.0) + sqlite3 (1.6.9-arm64-darwin) sqlite3 (1.6.9-x86_64-darwin) sqlite3 (1.6.9-x86_64-linux) standard (1.32.1) @@ -311,6 +314,7 @@ GEM zeitwerk (2.6.12) PLATFORMS + arm64-darwin-23 ruby x86_64-darwin-20 x86_64-linux diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock index ed638a12..a518752b 100644 --- a/gemfiles/sidekiq_6.gemfile.lock +++ b/gemfiles/sidekiq_6.gemfile.lock @@ -267,6 +267,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-22 x86_64-linux diff --git a/gemfiles/sidekiq_7.gemfile.lock b/gemfiles/sidekiq_7.gemfile.lock index 8c74bd1f..2ef64cda 100644 --- a/gemfiles/sidekiq_7.gemfile.lock +++ b/gemfiles/sidekiq_7.gemfile.lock @@ -269,6 +269,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-22 x86_64-linux From 55a71aa99dc3fa6ac3739491b1a9644b9fde80f8 Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Wed, 15 Feb 2023 21:53:09 +1100 Subject: [PATCH 29/31] Support "has_many through" relationships While there is some support for "through" relationships, when finding the association, the pluralized foreign key is used but join tables use singular key names BREAKING CHANGE Given an assumption is being made that singular tenant/association names are belongs_to and plural names are has_many, acts_as_tenant will no longer attempt to create a new association if one already exists. This will allow those with non-standard associations to manually define the relationship --- README.md | 2 +- lib/acts_as_tenant.rb | 2 +- lib/acts_as_tenant/model_extensions.rb | 36 ++++++++++++++++++++------ spec/dummy/app/models/account.rb | 3 +++ spec/dummy/app/models/user.rb | 5 ++-- spec/dummy/app/models/users_account.rb | 3 +++ spec/models/model_extensions_spec.rb | 5 ++++ 7 files changed, 44 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b51d9171..9076ce5a 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ end class User < ActiveRecord::Base has_many :organisations_users - acts_as_tenant :organisation, through: :organisations_users + acts_as_tenant :organisations, through: :organisations_users end class OrganisationsUser < ActiveRecord::Base diff --git a/lib/acts_as_tenant.rb b/lib/acts_as_tenant.rb index f4074015..09673ab7 100644 --- a/lib/acts_as_tenant.rb +++ b/lib/acts_as_tenant.rb @@ -59,7 +59,7 @@ def self.add_global_record_model model end def self.fkey - "#{@@tenant_klass}_id" + "#{@@tenant_klass.to_s.singularize}_id" end def self.pkey diff --git a/lib/acts_as_tenant/model_extensions.rb b/lib/acts_as_tenant/model_extensions.rb index 053b9b85..201b58b5 100644 --- a/lib/acts_as_tenant/model_extensions.rb +++ b/lib/acts_as_tenant/model_extensions.rb @@ -10,11 +10,24 @@ def acts_as_tenant(tenant = :account, scope = nil, **options) ActsAsTenant.add_global_record_model(self) if options[:has_global_records] # Create the association - valid_options = options.slice(:foreign_key, :class_name, :inverse_of, :optional, :primary_key, :counter_cache, :polymorphic, :touch) + valid_options = options.slice( + :foreign_key, :class_name, :inverse_of, :optional, :primary_key, :counter_cache, + :polymorphic, :source, :through, :touch + ) fkey = valid_options[:foreign_key] || ActsAsTenant.fkey pkey = valid_options[:primary_key] || ActsAsTenant.pkey polymorphic_type = valid_options[:foreign_type] || ActsAsTenant.polymorphic_type - belongs_to tenant, scope, **valid_options + + reflection = reflect_on_association(tenant) + reflection ||= begin + if tenant.to_s.singularize == tenant.to_s + belongs_to tenant, **valid_options + else + has_many tenant, **valid_options + end + + reflect_on_association(tenant) + end default_scope lambda { if ActsAsTenant.should_require_tenant? && ActsAsTenant.current_tenant.nil? && !ActsAsTenant.unscoped? @@ -46,10 +59,10 @@ def acts_as_tenant(tenant = :account, scope = nil, **options) before_validation proc { |m| if ActsAsTenant.current_tenant if options[:polymorphic] - m.send("#{fkey}=".to_sym, ActsAsTenant.current_tenant.class.to_s) if m.send(fkey.to_s).nil? - m.send("#{polymorphic_type}=".to_sym, ActsAsTenant.current_tenant.class.to_s) if m.send(polymorphic_type.to_s).nil? + m.send(:"#{fkey}=", ActsAsTenant.current_tenant.class.to_s) if m.send(fkey.to_s).nil? + m.send(:"#{polymorphic_type}=", ActsAsTenant.current_tenant.class.to_s) if m.send(polymorphic_type.to_s).nil? else - m.send "#{fkey}=".to_sym, ActsAsTenant.current_tenant.send(pkey) + m.send :"#{fkey}=", ActsAsTenant.current_tenant.send(pkey) end end }, on: :create @@ -80,13 +93,20 @@ def acts_as_tenant(tenant = :account, scope = nil, **options) # - Add an override to prevent unnecessary db hits # - Add a helper method to verify if a model has been scoped by AaT to_include = Module.new { - define_method "#{fkey}=" do |integer| - write_attribute(fkey.to_s, integer) + define_method :"#{fkey}=" do |integer| + if reflection.macro == :has_many + associations = public_send(reflection.name) + associations.find { |assoc| assoc.public_send(pkey) == integer } || + associations << ActsAsTenant.current_tenant + else + write_attribute(fkey.to_s, integer) + end + raise ActsAsTenant::Errors::TenantIsImmutable if !ActsAsTenant.mutable_tenant? && tenant_modified? integer end - define_method "#{ActsAsTenant.tenant_klass}=" do |model| + define_method :"#{ActsAsTenant.tenant_klass}=" do |model| super(model) raise ActsAsTenant::Errors::TenantIsImmutable if !ActsAsTenant.mutable_tenant? && tenant_modified? model diff --git a/spec/dummy/app/models/account.rb b/spec/dummy/app/models/account.rb index 77f4ce43..f1124eed 100644 --- a/spec/dummy/app/models/account.rb +++ b/spec/dummy/app/models/account.rb @@ -5,4 +5,7 @@ class Account < ActiveRecord::Base has_many :users, through: :users_accounts default_scope -> { where(deleted_at: nil) } + + has_many :org_users_accounts, class_name: "UsersAccount" + has_many :org_users, class_name: "User", through: :org_users_accounts end diff --git a/spec/dummy/app/models/user.rb b/spec/dummy/app/models/user.rb index b1a33792..9b738ade 100644 --- a/spec/dummy/app/models/user.rb +++ b/spec/dummy/app/models/user.rb @@ -1,6 +1,7 @@ class User < ActiveRecord::Base has_many :users_accounts - has_many :accounts, through: :users_accounts + acts_as_tenant :accounts, through: :users_accounts - acts_as_tenant :account, through: :users_accounts + has_many :org_users_accounts, class_name: "UsersAccount", inverse_of: :org_user + acts_as_tenant :organizations, through: :org_users_accounts, source: :org_account, class_name: "Account", foreign_key: :account_id end diff --git a/spec/dummy/app/models/users_account.rb b/spec/dummy/app/models/users_account.rb index aa59bde1..520372f9 100644 --- a/spec/dummy/app/models/users_account.rb +++ b/spec/dummy/app/models/users_account.rb @@ -1,4 +1,7 @@ class UsersAccount < ActiveRecord::Base acts_as_tenant :account belongs_to :user + + acts_as_tenant :org_account, class_name: "Account", foreign_key: :account_id + belongs_to :org_user, class_name: "User", foreign_key: :user_id end diff --git a/spec/models/model_extensions_spec.rb b/spec/models/model_extensions_spec.rb index ef6f25ba..6c296eae 100644 --- a/spec/models/model_extensions_spec.rb +++ b/spec/models/model_extensions_spec.rb @@ -121,6 +121,11 @@ ActsAsTenant.current_tenant = account expect(User.unscoped.count).to be > account.users.count end + + it "allows users to be created for the current tenant" do + ActsAsTenant.current_tenant = account + expect(User.create).to be_present + end end describe "A tenant model with global records" do From 782a6920a45d1c640c2157e09706f86b3ed2a0e5 Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Wed, 29 Mar 2023 16:34:21 +1100 Subject: [PATCH 30/31] Support manual creation of HABTM record ActsAsTenant assumes that it needs to create an association with the tenant unless a record already exists when calling the tenant association. Unfortunately, until the parent record has been persisted, Active Record will not be able to find the association using the tenant association because the join record will not have an ID --- lib/acts_as_tenant/model_extensions.rb | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/acts_as_tenant/model_extensions.rb b/lib/acts_as_tenant/model_extensions.rb index 201b58b5..e0efc103 100644 --- a/lib/acts_as_tenant/model_extensions.rb +++ b/lib/acts_as_tenant/model_extensions.rb @@ -96,8 +96,32 @@ def acts_as_tenant(tenant = :account, scope = nil, **options) define_method :"#{fkey}=" do |integer| if reflection.macro == :has_many associations = public_send(reflection.name) - associations.find { |assoc| assoc.public_send(pkey) == integer } || - associations << ActsAsTenant.current_tenant + # If an association has been created manually on a has_and_belongs_to_many before the + # parent record has been persisted, it won't be found by calling the tenant + # association since Active Record will notice the lack of ID on the parent record. We + # can, however, find the tenant via the join record + association = + if public_send(pkey).nil? && reflection.options[:through] + through_association_name = reflection.options.fetch(:through).to_s + through_association = self.class.reflections[through_association_name] + through_tenant_association_name = + through_association.options[:inverse_of] || + reflection.name.to_s.singularize + through_tenant_association = through_association.klass.reflections[through_tenant_association_name.to_s] + + through_resource_key = through_association.foreign_key + through_tenant_key = through_tenant_association.foreign_key + tenant_primary_key = through_tenant_association.klass.primary_key + + through_associations = public_send(reflection.options.fetch(:through)) + through_associations.find do |assoc| + assoc.public_send(through_resource_key) == id && + assoc.public_send(through_tenant_key) == integer + end + else + associations.find { |assoc| assoc.public_send(pkey) == integer } + end + association || associations << ActsAsTenant.current_tenant else write_attribute(fkey.to_s, integer) end From 90f40a27c9c382800ebaaa8e8cfcddde38f0bb97 Mon Sep 17 00:00:00 2001 From: Trevor John Date: Fri, 19 Jan 2024 17:35:16 -0500 Subject: [PATCH 31/31] Test with Ruby 3.3 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 081e91fe..593daf55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: name: ruby-${{ matrix.ruby }} ${{ matrix.gemfile }} strategy: matrix: - ruby: ['2.7', '3.0', '3.1', '3.2'] + ruby: ['3.0', '3.1', '3.2', '3.3'] gemfile: - rails_6 - rails_6_1 @@ -32,9 +32,9 @@ jobs: BUNDLE_PATH_RELATIVE_TO_CWD: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@v2 with: ruby-version: ${{ matrix.ruby }} bundler: default