Exception: Mongoid::Errors::InvalidDotDollarAssignment

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/invalid_dot_dollar_assignment.rb

Overview

This error is raised when trying to use the setter for a field that starts with a dollar sign ($) or contains a dot/period (.).

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(klass, attr) ⇒ InvalidDotDollarAssignment

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create the new error.

Parameters:

  • klass (Class)

    The class of the document.

  • attr (Class)

    The attribute attempted to be written.



17
18
19
20
21
# File 'lib/mongoid/errors/invalid_dot_dollar_assignment.rb', line 17

def initialize(klass, attr)
  super(
    compose_message("invalid_dot_dollar_assignment", { klass: klass, attr: attr })
  )
end