diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 22248c0..5aa834a 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -13,19 +13,19 @@ jobs: preflight_check: name: Preflight Check runs-on: ubuntu-latest - # do a matrix for ACTIVERECORD_VERSION of 6.1 and 7.0 + # do a matrix for ACTIVERECORD_VERSION of 7.2 and 8.1 strategy: matrix: activerecord_version: - - 6.1 - - 7.0 + - 7.2 + - 8.1 steps: # Need to fetch all refs, so we can check if the version has been bumped - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 - - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@97ecb7b512899eb71ab1bf2310a624c6f1589ac6 # v1.308.0 with: bundler-cache: true env: diff --git a/.ruby-version b/.ruby-version index 6ebad14..7bcbb38 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.2 \ No newline at end of file +3.4.9 diff --git a/CHANGELOG.md b/CHANGELOG.md index 52ef721..f08eb31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # attr_encrypted # +## 3.2.0 ## +* Changed: Ruby minimum version raised to 3.4.x. +* Changed: CI test matrix updated to ActiveRecord 7.2 and 8.1. ActiveRecord 6.x is no longer included in the test matrix and is not actively supported. +* Fixed: Removed Rails 4.0.x minitest compatibility shim that caused a `NameError` on modern minitest. +* Fixed: Guarded `ActiveSupport::Deprecation` calls that were removed in Rails 7.1+. +* Fixed: Replaced `stub` usage in tests with `define_singleton_method` for minitest 6 compatibility. + ## 3.1.0 ## * Added: Abitilty to encrypt empty values. (@tamird) * Added: MIT license diff --git a/lib/attr_encrypted/version.rb b/lib/attr_encrypted/version.rb index 723ebe9..d2502d7 100644 --- a/lib/attr_encrypted/version.rb +++ b/lib/attr_encrypted/version.rb @@ -4,7 +4,7 @@ module AttrEncrypted # Contains information about this gem's version module Version MAJOR = 3 - MINOR = 1 + MINOR = 2 PATCH = 0 # Returns a version string by joining MAJOR, MINOR, and PATCH with '.' diff --git a/test/attr_encrypted_test.rb b/test/attr_encrypted_test.rb index 0df966a..2903b73 100644 --- a/test/attr_encrypted_test.rb +++ b/test/attr_encrypted_test.rb @@ -482,9 +482,8 @@ def test_encrypted_attributes_state_is_not_shared def test_should_not_by_default_generate_key_when_attribute_is_empty user = User.new calls = 0 - user.stub(:secret_key, lambda { calls += 1; SECRET_KEY }) do - user.ssn - end + user.define_singleton_method(:secret_key) { calls += 1; SECRET_KEY } + user.ssn assert_equal 0, calls end end diff --git a/test/legacy_active_record_test.rb b/test/legacy_active_record_test.rb index 8023185..8c1f3da 100644 --- a/test/legacy_active_record_test.rb +++ b/test/legacy_active_record_test.rb @@ -29,9 +29,9 @@ class LegacyPerson < ActiveRecord::Base attr_encrypted :email, :key => 'a secret key' attr_encrypted :credentials, :key => Proc.new { |user| Encryptor.encrypt(:value => user.salt, :key => 'some private key', insecure_mode: true, algorithm: 'aes-256-cbc') }, :marshal => true - ActiveSupport::Deprecation.silenced = true + ActiveSupport::Deprecation.silenced = true if defined?(ActiveSupport::Deprecation) && ActiveSupport::Deprecation.respond_to?(:silenced=) def after_initialize; end - ActiveSupport::Deprecation.silenced = false + ActiveSupport::Deprecation.silenced = false if defined?(ActiveSupport::Deprecation) && ActiveSupport::Deprecation.respond_to?(:silenced=) after_initialize :initialize_salt_and_credentials diff --git a/test/test_helper.rb b/test/test_helper.rb index f82e632..e5b0f9e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,15 +2,10 @@ require 'minitest/autorun' -# Rails 4.0.x pins to an old minitest -unless defined?(MiniTest::Test) - MiniTest::Test = MiniTest::Unit::TestCase -end - require 'active_record' require 'digest/sha2' require 'sequel' -ActiveSupport::Deprecation.behavior = :raise +ActiveSupport::Deprecation.behavior = :raise if defined?(ActiveSupport::Deprecation) && ActiveSupport::Deprecation.respond_to?(:behavior=) $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $:.unshift(File.dirname(__FILE__))