lib/mongoid/kms.rb in mongoid-kms-0.0.9 vs lib/mongoid/kms.rb in mongoid-kms-0.0.10
- old
+ new
@@ -52,23 +52,23 @@
encryption_context: kms_context(field_name)
})[:plaintext]
end
def kms_context(field_name)
- c = @ksm_field_map[field_name.to_s][:context]
+ c = @kms_field_map[field_name.to_s][:context]
c = c.call(self) if c.is_a?(Proc)
c
end
- def ksm_type(field_name)
- @ksm_field_map[field_name.to_s][:type]
+ def kms_type(field_name)
+ @kms_field_map[field_name.to_s][:type]
end
def secure_field(field_name, args)
encrypted_field_name = "kms_secure_#{field_name}"
- @ksm_field_map ||= {}
- @ksm_field_map[field_name.to_s] = {context: args.delete(:context), type: args.delete(:type)}
+ @kms_field_map ||= {}
+ @kms_field_map[field_name.to_s] = {context: args.delete(:context), type: args.delete(:type)}
field encrypted_field_name, args.merge(type: Mongoid::Kms.bson_class::Binary)
define_method(field_name) do
instance_variable_get("@#{field_name}") || begin