lib/mongoid/kms.rb in mongoid-kms-0.0.21 vs lib/mongoid/kms.rb in mongoid-kms-0.0.22
- old
+ new
@@ -7,14 +7,10 @@
extend ActiveSupport::Concern
included do
class_attribute :kms_field_map
self.kms_field_map ||= {}
-
- unless self.ancestors.include?(ActiveModel::Dirty)
- include ActiveModel::Dirty
- end
end
@configuration = {}
@kms = nil
@@ -142,10 +138,10 @@
end
def secure_field(field_name, args)
encrypted_field_name = get_encrypted_field_name(field_name)
- define_attribute_methods field_name.to_sym
+ create_dirty_methods field_name, field_name
before_save :set_kms_values
kms_field_map[field_name.to_s] = {context: args.delete(:context), type: args[:type]}
field encrypted_field_name, type: Mongoid::Kms.bson_class::Binary