aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-08-16 00:45:58 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-08-16 00:45:58 +0900
commitceaafe52b91751aa210c2df9c4cde59e7448be3d (patch)
treeac77e9ef2d037a27bba0064380dca70c54df2e43 /activerecord/lib/active_record/attribute_methods
parentfbeebded22f53337df339285164352f298639c63 (diff)
downloadrails-ceaafe52b91751aa210c2df9c4cde59e7448be3d.tar.gz
rails-ceaafe52b91751aa210c2df9c4cde59e7448be3d.tar.bz2
rails-ceaafe52b91751aa210c2df9c4cde59e7448be3d.zip
Don't expose `write_attribute_without_type_cast`
`write_attribute_without_type_cast` is defined as a private method in `AttributeMethods::Write`, but `AttributeMethods::Dirty` overrode it as a public method. It should be kept the original visibility.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/dirty.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb
index 48d33e6744..c622df132e 100644
--- a/activerecord/lib/active_record/attribute_methods/dirty.rb
+++ b/activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -62,12 +62,6 @@ module ActiveRecord
clear_mutation_trackers
end
- def write_attribute_without_type_cast(attr_name, *) # :nodoc:
- result = super
- clear_attribute_change(attr_name)
- result
- end
-
def clear_attribute_changes(attr_names) # :nodoc:
super
attr_names.each do |attr_name|
@@ -183,6 +177,11 @@ module ActiveRecord
end
private
+ def write_attribute_without_type_cast(attr_name, _)
+ result = super
+ clear_attribute_change(attr_name)
+ result
+ end
def mutation_tracker
unless defined?(@mutation_tracker)