类:Mongoid::Deprecation

继承:
ActiveSupport::Deprecation
  • 对象
显示全部
定义于:
lib/mongoid/deprecation.rb

Overview

用于记录弃用警告的实用程序类。

实例方法摘要折叠

构造函数详情

#初始化弃用

返回弃用的新实例。



9
10
11
12
13
14
# File 'lib/mongoid/deprecation.rb', line 9

def 初始化
  # 根据变更策略,弃用内容将在下一个主要版本中删除。
  deprecation_horizon = " #{ Mongoid :: VERSION . 分割 ( ' . ' ) . first . to_i + 1 } 。 0 ".冻结
  gem_name = ' Mongoid '
  (deprecation_horizon, gem_name)
end

实例方法详细信息

#behaviorArray<Proc>

覆盖默认的 ActiveSupport::Deprecation 行为以使用 Mongoid 的记录器。

返回:

  • ( Array<Proc> )

    弃用行为。



21
22
23
24
25
26
27
# File 'lib/mongoid/deprecation.rb', line 21

def 行为
  @behavior ||= 阵列(->(*args) {
    记录器 = Mongoid.记录器
    记录器.WARN(args[0])
    记录器.debug(args[1].连接 (JOIN)(" \n ")) if debug
  })
end