lib/symmetric_encryption.rb in symmetric-encryption-4.4.0 vs lib/symmetric_encryption.rb in symmetric-encryption-4.5.0

- old
+ new

@@ -15,10 +15,13 @@ if ActiveRecord.version >= Gem::Version.new("5.0.0") ActiveRecord::Type.register(:encrypted, SymmetricEncryption::ActiveRecord::EncryptedAttribute) end - ActiveRecord::Base.include(SymmetricEncryption::ActiveRecord::AttrEncrypted) + # Remove old way of defining attributes with Rails 7 since it conflicts with the method names. + if ActiveRecord.version <= Gem::Version.new("7.0.0") + ActiveRecord::Base.include(SymmetricEncryption::ActiveRecord::AttrEncrypted) + end end ActiveSupport.on_load(:mongoid) do require "symmetric_encryption/railties/mongoid_encrypted" require "symmetric_encryption/railties/symmetric_encryption_validator"