This module defines behaviour for readonly attributes.
Are we able to write the attribute with the provided name?
@example Can we write the attribute?
model.attribute_writable?(:title)
@param [ String, Symbol ] name The name of the field.
@return [ true, false ] If the document is new, or if the field is not
readonly.
@since 3.0.0
# File lib/mongoid/attributes/readonly.rb, line 24 def attribute_writable?(name) new_record? || !readonly_attributes.include?(name.to_s) end
Generated with the Darkfish Rdoc Generator 2.