Exception: Mongoid::Errors::UnsupportedJavascript

Inherits:
MongoidError
  • Object
show all
Defined in:
build/mongoid-master/lib/mongoid/errors/unsupported_javascript.rb

Overview

Raised when Javascript criteria selector is passed for embedded document.

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, javascript) ⇒ UnsupportedJavascript

Create the new error caused by using Javascript in embedded document criteria selector.

Examples:

Create the error.

UnsupportedJavascriptSelector.new(Album, "this.name == '101'")

Parameters:

  • klass (Class)

    The embedded document class.

  • javascript (String)

    The javascript expression.

Since:

  • 3.0.0



19
20
21
22
23
24
25
26
# File 'build/mongoid-master/lib/mongoid/errors/unsupported_javascript.rb', line 19

def initialize(klass, javascript)
  super(
    compose_message(
      "unsupported_javascript",
      { klass: klass, javascript: javascript }
    )
  )
end