Module: Mongoid::Attributes::Readonly
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Attributes
- Defined in:
- lib/mongoid/attributes/readonly.rb
Overview
This module defines behaviour for readonly attributes.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#attribute_writable?(name) ⇒ true, false
deprecated
Deprecated.
Use #as_writable_attribute! instead.
Instance Method Details
#attribute_writable?(name) ⇒ true, false
Deprecated.
Use #as_writable_attribute! instead.
Are we able to write the attribute with the provided name?
27 28 29 |
# File 'lib/mongoid/attributes/readonly.rb', line 27 def attribute_writable?(name) new_record? || !readonly_attributes.include?(database_field_name(name)) end |