异常:Mongoid::Errors::InverseNotFound

继承:
MongoidError
  • 对象
显示全部
定义于:
lib/mongoid/errors/inverse_not_Found.rb

Overview

在需要时找不到 inverse_of 定义时触发。

常量摘要

MongoidError继承的常量

MongoidError::BASE_KEY

实例属性摘要

MongoidError继承的属性

#问题#分辨率#summary

实例方法摘要折叠

MongoidError继承的方法

#compose_message

构造函数详情

#initialize (base, name, klass, inverse) ⇒ InverseNotFound

然后创建新的错误。

例子:

创建新的错误。

InverseNotFound.new(Town, :citizens, Person, :town_id)

参数:

  • 基础 ( class )

    基类。

  • 名称 (符号)

    关联的名称。

  • klass ( class )

    子类。

  • 反向 (符号)

    尝试的反向密钥。



19
20
21
22
23
24
25
26
# File 'lib/mongoid/errors/inverse_not_Found.rb', line 19

def 初始化(基础, 名称, klass, 反向)
  (
    compose_message(
      " inverse_not_Found ",
      { 基础: 基础, 名称: 名称, 类: klass, 反向: 反向 }
    )
  )
end