diff --git a/diffcrypt.gemspec b/diffcrypt.gemspec index e28ed9a..3ae32cd 100644 --- a/diffcrypt.gemspec +++ b/diffcrypt.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| spec.executables = %w[diffcrypt] spec.require_paths = ['lib'] - spec.add_runtime_dependency 'activesupport', '>= 6.0', '< 7.1' + spec.add_runtime_dependency 'activesupport', '>= 6.0', '< 7.2' spec.add_runtime_dependency 'thor', '>= 0.20', '< 2' spec.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/diffcrypt/encryptor.rb b/lib/diffcrypt/encryptor.rb index 2bfc98b..eefc4d1 100644 --- a/lib/diffcrypt/encryptor.rb +++ b/lib/diffcrypt/encryptor.rb @@ -6,6 +6,7 @@ require 'securerandom' require 'yaml' +require 'active_support' # NOTE: This is required because of a bug in 7.1 which needs deprecation libs require 'active_support/message_encryptor' require_relative './version' diff --git a/lib/diffcrypt/rails/encrypted_configuration.rb b/lib/diffcrypt/rails/encrypted_configuration.rb index 63a3583..405531f 100644 --- a/lib/diffcrypt/rails/encrypted_configuration.rb +++ b/lib/diffcrypt/rails/encrypted_configuration.rb @@ -68,6 +68,14 @@ def key read_env_key || read_key_file || handle_missing_key end + # It's required since the commit https://github.com/rails/rails/commit/1740b1f2cb8104435b6041ec6bfaabe58a6d74e6 + # Returns truthy if #key is truthy. Returns falsy otherwise. Unlike #key, + # does not raise MissingKeyError when +raise_if_missing_key+ is true. + # @return [Boolean] + def key? + !!(read_env_key || read_key_file) + end + def change(&block) writing read, &block end diff --git a/test/rails_test.rb b/test/rails_test.rb index 73d54f4..360da83 100644 --- a/test/rails_test.rb +++ b/test/rails_test.rb @@ -7,7 +7,8 @@ RAILS_VERSIONS = %w[ 6.1.7.7 - 7.0.8.1 + 7.0.8.3 + 7.1.3.3 ].freeze RAILS_FLAGS = %w[