aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/dirty.rb2
-rw-r--r--activerecord/lib/active_record/attribute_methods/write.rb12
2 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb
index 76987fb8f4..7bf5c7485f 100644
--- a/activerecord/lib/active_record/attribute_methods/dirty.rb
+++ b/activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -80,7 +80,7 @@ module ActiveRecord
clear_mutation_trackers
end
- def raw_write_attribute(attr_name, *)
+ def write_attribute_without_type_cast(attr_name, *)
result = super
clear_attribute_change(attr_name)
result
diff --git a/activerecord/lib/active_record/attribute_methods/write.rb b/activerecord/lib/active_record/attribute_methods/write.rb
index d7ddd35dff..54b673c72e 100644
--- a/activerecord/lib/active_record/attribute_methods/write.rb
+++ b/activerecord/lib/active_record/attribute_methods/write.rb
@@ -39,12 +39,6 @@ module ActiveRecord
_write_attribute(name, value)
end
- def raw_write_attribute(attr_name, value) # :nodoc:
- name = attr_name.to_s
- @attributes.write_cast_value(name, value)
- value
- end
-
# This method exists to avoid the expensive primary_key check internally, without
# breaking compatibility with the write_attribute API
def _write_attribute(attr_name, value) # :nodoc:
@@ -53,6 +47,12 @@ module ActiveRecord
end
private
+ def write_attribute_without_type_cast(attr_name, value)
+ name = attr_name.to_s
+ @attributes.write_cast_value(name, value)
+ value
+ end
+
# Handle *= for method_missing.
def attribute=(attribute_name, value)
_write_attribute(attribute_name, value)