Skip to content

Commit

Permalink
Support binary encryption on PostgreSQL for Rails 8
Browse files Browse the repository at this point in the history
Support was added in rails/rails#52729, so we
can remove the check for Rails 8.
  • Loading branch information
djmb committed Sep 2, 2024
1 parent 03e3093 commit e35c3f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ end
configs.each do |config|
namespace :test do
task config do
if config.to_s.start_with?("encrypted") && ENV["TARGET_DB"] == "postgres"
if config.to_s.start_with?("encrypted") && ENV["TARGET_DB"] == "postgres" && Rails::VERSION::MAJOR <= 7
puts "Skipping encrypted tests on PostgreSQL as binary encrypted columns are not supported by Rails yet"
next
end
Expand Down
4 changes: 2 additions & 2 deletions lib/solid_cache/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class Engine < ::Rails::Engine
end

config.after_initialize do
if SolidCache.configuration.encrypt? && SolidCache::Record.connection.adapter_name == "PostgreSQL"
if SolidCache.configuration.encrypt? && Record.connection.adapter_name == "PostgreSQL" && Rails::VERSION::MAJOR <= 7
raise \
"Cannot enable encryption for Solid Cache: Active Record Encryption does not currently support " \
"Cannot enable encryption for Solid Cache: in Rails 7, Active Record Encryption does not support " \
"encrypting binary columns on PostgreSQL"
end
end
Expand Down

0 comments on commit e35c3f4

Please sign in to comment.