module Mongoid::Encrypted::ClassMethods

Protected Instance Methods

field_for(name, options) click to toggle source
Calls superclass method
# File lib/mongoid/encrypted.rb, line 28
def field_for(name, options)
  return super unless options[:encrypted]

  opts = options.merge(klass: self)
  type_mapping = Fields::TYPE_MAPPINGS[options[:type]]
  opts[:type] = type_mapping || unmapped_type(options)
  Fields::Encrypted.new(name, opts)
end