模块:Mongoid::Attributes::Readonly
Overview
此模块定义只读属性的行为。
在命名空间下定义
模块: 类方法
实例方法摘要折叠
-
#attribute_writable? (name) ⇒ true | false
我们是否能够使用提供的名称写入属性?
实例方法详细信息
#attribute_writable? (name) ⇒ true | false
我们是否能够使用提供的名称写入属性?
25 26 27 |
# File 'lib/mongoid/attributes/readonly.rb', line 25 def attribute_writable?(名称) new_record? || (!self.class.readonly_attributes.包括?(名称) && _loaded?(名称)) end |