123456789_123456789_123456789_123456789_123456789_

Exception: Mongoid::Errors::NoEncryptionSchema

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, MongoidError, StandardError
Instance Chain:
self, MongoidError, StandardError
Inherits: Mongoid::Errors::MongoidError
Defined in: lib/mongoid/errors/no_encryption_schema.rb

Overview

This error is raised when a model declares encrypted fields, but the namespace it is about to be persisted to is not covered by the automatic encryption schema of the client in use. Without a schema the driver has nothing to encrypt with, and the fields would be stored in plaintext.

Constant Summary

MongoidError - Inherited

BASE_KEY

Class Method Summary

Instance Attribute Summary

Instance Method Summary

MongoidError - Inherited

#compose_message

Compose the message.

#translate

Given the key of the specific error and the options hash, translate the message.

#translate_problem

Create the problem.

#translate_resolution

Create the resolution.

#translate_summary

Create the summary.

Constructor Details

.new(klass, namespace, client) ⇒ NoEncryptionSchema

Create the new error.

Examples:

Create the error.

NoEncryptionSchema.new(Band, 'music.bands', :default)

Parameters:

  • klass (Class) —

    The model class.

  • namespace (String) —

    The namespace the model resolved to.

  • client (String | Symbol) —

    The name of the client in use.

[ GitHub ]

  
# File 'lib/mongoid/errors/no_encryption_schema.rb', line 18

def initialize(klass, namespace, client)
  super(
    compose_message(
      'no_encryption_schema',
      { klass: klass, namespace: namespace, client: client }
    )
  )
end