lib/symmetric_encryption/extensions/mongoid/encrypted.rb in symmetric-encryption-3.7.2 vs lib/symmetric_encryption/extensions/mongoid/encrypted.rb in symmetric-encryption-3.8.0

- old
+ new

@@ -8,11 +8,11 @@ # # Initialize Mongoid in a standalone environment. In a Rails app this is not required # Mongoid.logger = Logger.new($stdout) # Mongoid.load!('config/mongoid.yml') # # # Initialize SymmetricEncryption in a standalone environment. In a Rails app this is not required -# SymmetricEncryption.load!('config/symmetric-encryption.yml', 'test') +# SymmetricEncryption::Config.load!('config/symmetric-encryption.yml', 'test') # # class Person # include Mongoid::Document # # field :name, type: String @@ -87,10 +87,10 @@ # @option options [ Object, Proc ] :default The fields default # # @return [ Field ] The generated field Mongoid::Fields.option :encrypted do |model, field, options| if options != false - options = options.is_a?(Hash) ? options.dup : {} + options = options.is_a?(Hash) ? options.dup : {} encrypted_field_name = field.name # Support overriding the name of the decrypted attribute decrypted_field_name = options.delete(:decrypt_as) if decrypted_field_name.nil? && encrypted_field_name.to_s.start_with?('encrypted_')