Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.4.9
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Comment thread
scottybarr marked this conversation as resolved.
* 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
Expand Down
2 changes: 1 addition & 1 deletion lib/attr_encrypted/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tt>MAJOR</tt>, <tt>MINOR</tt>, and <tt>PATCH</tt> with <tt>'.'</tt>
Expand Down
5 changes: 2 additions & 3 deletions test/attr_encrypted_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions test/legacy_active_record_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 1 addition & 6 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand Down