From ebb197544e5ee4a9853ba245c0047887b33c5020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 6 Dec 2022 15:55:56 +0000 Subject: [PATCH] 2.2.0: Remove support for Ruby 2.5 & ActiveRecord 5.2 --- .github/workflows/CI.yml | 16 ------------- Appraisals | 24 ------------------- CHANGELOG.md | 4 ++++ README.md | 2 +- activerecord-multi-tenant.gemspec | 2 +- gemfiles/active_record_5.2.gemfile | 16 ------------- gemfiles/rails_5.2.gemfile | 16 ------------- .../model_extensions.rb | 1 - lib/activerecord-multi-tenant/version.rb | 2 +- 9 files changed, 7 insertions(+), 76 deletions(-) delete mode 100644 gemfiles/active_record_5.2.gemfile delete mode 100644 gemfiles/rails_5.2.gemfile diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d22b6b67..718620cb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,40 +13,24 @@ jobs: fail-fast: false matrix: ruby: - - '2.5' - '2.6' - '2.7' - '3.0' - '3.1' gemfile: - - rails_5.2 - rails_6.0 - rails_6.1 - rails_7.0 - - active_record_5.2 - active_record_6.0 - active_record_6.1 - active_record_7.0 prepared_statements: [true, false] exclude: # activesupport-7.0.0 requires ruby version >= 2.7.0 - - ruby: '2.5' - gemfile: 'rails_7.0' - - ruby: '2.5' - gemfile: 'active_record_7.0' - ruby: '2.6' gemfile: 'rails_7.0' - ruby: '2.6' gemfile: 'active_record_7.0' - # ruby >3 and activesupport 5.2 are not compatible - - ruby: '3.0' - gemfile: 'rails_5.2' - - ruby: '3.0' - gemfile: 'active_record_5.2' - - ruby: '3.1' - gemfile: 'rails_5.2' - - ruby: '3.1' - gemfile: 'active_record_5.2' name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} ${{ (matrix.prepared_statements && 'w/ prepared statements') || '' }} env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile diff --git a/Appraisals b/Appraisals index bb141136..abac38c4 100644 --- a/Appraisals +++ b/Appraisals @@ -1,15 +1,3 @@ -appraise 'rails-5.2' do - gem 'rails', '~> 5.2.0' - gem 'i18n', '~> 0.9.5' - gem 'nokogiri', '~> 1.7.1' - gem 'nio4r', '~> 2.3.1' - gem 'sprockets', '~> 3.7.1' - gem 'byebug', '~> 11.0' - gem 'rake', '12.0.0' - gem 'redis', '3.3.3' - gem 'pry-byebug', '3.9.0' -end - appraise 'rails-6.0' do gem 'rails', '~> 6.0.3' end @@ -22,18 +10,6 @@ appraise 'rails-7.0' do gem 'rails', '~> 7.0.0' end -appraise 'active-record-5.2' do - gem 'activerecord', '~> 5.2.0' - gem 'i18n', '~> 0.9.5' - gem 'nokogiri', '~> 1.7.1' - gem 'nio4r', '~> 2.3.1' - gem 'sprockets', '~> 3.7.1' - gem 'byebug', '~> 11.0' - gem 'rake', '12.0.0' - gem 'redis', '3.3.3' - gem 'pry-byebug', '3.9.0' -end - appraise 'active-record-6.0' do gem 'activerecord', '~> 6.0.3' end diff --git a/CHANGELOG.md b/CHANGELOG.md index 91521a79..d5f205c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## 2.2.0 2022-12-06 * Handle changing tenant from `nil` to a value [#173](https://github.com/citusdata/activerecord-multi-tenant/pull/173) +* Allow Partitioned tables to be created without a primary key [#172](https://github.com/citusdata/activerecord-multi-tenant/pull/172) +* Only attempt to reload with MultiTenant when parition_key is present [#175](https://github.com/citusdata/activerecord-multi-tenant/pull/175) +* Remove support for Ruby 2.5 & ActiveRecord 5.2 ## 2.1.6 2022-11-23 * Fix undefined wrap_methods error & wrap_methods version check [#170](https://github.com/citusdata/activerecord-multi-tenant/pull/170) diff --git a/README.md b/README.md index 822ecfe5..3d589cea 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ gem 'activerecord-multi-tenant' ## Supported Rails versions -All Ruby on Rails versions starting with 5.2 or newer (up to 7.0) are supported. +All Ruby on Rails versions starting with 6.0 or newer (up to 7.0) are supported. This gem only supports ActiveRecord (the Rails default ORM), and not alternative ORMs like Sequel. diff --git a/activerecord-multi-tenant.gemspec b/activerecord-multi-tenant.gemspec index ac46476b..28aada5e 100644 --- a/activerecord-multi-tenant.gemspec +++ b/activerecord-multi-tenant.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/citusdata/activerecord-multi-tenant' s.license = 'MIT' - s.add_dependency 'rails', '>= 5.2' + s.add_dependency 'rails', '>= 6' s.add_development_dependency 'rspec', '>= 3.0' s.add_development_dependency 'rspec-rails' diff --git a/gemfiles/active_record_5.2.gemfile b/gemfiles/active_record_5.2.gemfile deleted file mode 100644 index 40886171..00000000 --- a/gemfiles/active_record_5.2.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "activerecord", "~> 5.2.0" -gem "i18n", "~> 0.9.5" -gem "nokogiri", "~> 1.7.1" -gem "nio4r", "~> 2.3.1" -gem "sprockets", "~> 3.7.1" -gem "byebug", "~> 11.0" -gem "rake", "12.0.0" -gem "redis", "3.3.3" -gem "pry-byebug", "3.9.0" - -gemspec path: "../" diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile deleted file mode 100644 index 3124d81a..00000000 --- a/gemfiles/rails_5.2.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "rails", "~> 5.2.0" -gem "i18n", "~> 0.9.5" -gem "nokogiri", "~> 1.7.1" -gem "nio4r", "~> 2.3.1" -gem "sprockets", "~> 3.7.1" -gem "byebug", "~> 11.0" -gem "rake", "12.0.0" -gem "redis", "3.3.3" -gem "pry-byebug", "3.9.0" - -gemspec path: "../" diff --git a/lib/activerecord-multi-tenant/model_extensions.rb b/lib/activerecord-multi-tenant/model_extensions.rb index d9722b60..08e588ee 100644 --- a/lib/activerecord-multi-tenant/model_extensions.rb +++ b/lib/activerecord-multi-tenant/model_extensions.rb @@ -75,7 +75,6 @@ def inherited(subclass) # Rails 5 `attribute_will_change!` uses the attribute-method-call rather than `read_attribute` # and will raise ActiveModel::MissingAttributeError if that column was not selected. # This is rescued as NoMethodError and in MRI attribute_was is assigned an arbitrary Object - # This is still true after the Rails 5.2 refactor was = send("#{partition_key}_was") was_nil_or_skipped = was.nil? || was.class == Object diff --git a/lib/activerecord-multi-tenant/version.rb b/lib/activerecord-multi-tenant/version.rb index a0a5bce4..1a1c9d45 100644 --- a/lib/activerecord-multi-tenant/version.rb +++ b/lib/activerecord-multi-tenant/version.rb @@ -1,3 +1,3 @@ module MultiTenant - VERSION = '2.1.6' + VERSION = '2.2.0' end