lib/symmetric_encryption/extensions/mongoid/encrypted.rb in symmetric-encryption-3.6.0 vs lib/symmetric_encryption/extensions/mongoid/encrypted.rb in symmetric-encryption-3.7.0
- old
+ new
@@ -97,10 +97,10 @@
if decrypted_field_name.nil? && encrypted_field_name.to_s.start_with?('encrypted_')
decrypted_field_name = encrypted_field_name.to_s['encrypted_'.length..-1]
end
if decrypted_field_name.nil?
- raise "SymmetricEncryption for Mongoid. Encryption enabled for field #{encrypted_field_name}. It must either start with 'encrypted_' or the option :decrypt_as must be supplied"
+ raise(ArgumentError, "SymmetricEncryption for Mongoid. Encryption enabled for field #{encrypted_field_name}. It must either start with 'encrypted_' or the option :decrypt_as must be supplied")
end
SymmetricEncryption::Generator.generate_decrypted_accessors(model, decrypted_field_name, encrypted_field_name, options)
end
end