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