Module: AdaptiveAlias::ActiveModelPatches::WriteAttribute
- Included in:
- ActiveRecord::Base
- Defined in:
- lib/adaptive_alias/active_model_patches/write_attribute.rb
Instance Method Summary collapse
-
#_write_attribute(attr_name, value) ⇒ Object
This method exists to avoid the expensive primary_key check internally, without breaking compatibility with the write_attribute API.
- #write_attribute(attr_name, value) ⇒ Object
Instance Method Details
#_write_attribute(attr_name, value) ⇒ Object
This method exists to avoid the expensive primary_key check internally, without breaking compatibility with the write_attribute API
14 15 16 17 18 |
# File 'lib/adaptive_alias/active_model_patches/write_attribute.rb', line 14 def _write_attribute(attr_name, value) # :nodoc: name = attr_name.to_s name = self.class.attribute_aliases[name] || name super(name, value) end |
#write_attribute(attr_name, value) ⇒ Object
6 7 8 9 10 |
# File 'lib/adaptive_alias/active_model_patches/write_attribute.rb', line 6 def write_attribute(attr_name, value) name = attr_name.to_s name = self.class.attribute_aliases[name] || name super(name, value) end |