Module: ActiveRecord::ReadonlyAttributes::HasReadonlyAttributes
Do not use. This module is for internal use only.
Relationships & Source Files | |
Defined in: | activerecord/lib/active_record/readonly_attributes.rb |
Instance Method Summary
Instance Method Details
#_write_attribute(attr_name, value)
[ GitHub ]# File 'activerecord/lib/active_record/readonly_attributes.rb', line 57
def _write_attribute(attr_name, value) if !new_record? && self.class.readonly_attribute?(attr_name.to_s) raise ReadonlyAttributeError.new(attr_name) end super end
#write_attribute(attr_name, value)
[ GitHub ]# File 'activerecord/lib/active_record/readonly_attributes.rb', line 49
def write_attribute(attr_name, value) if !new_record? && self.class.readonly_attribute?(attr_name.to_s) raise ReadonlyAttributeError.new(attr_name) end super end