aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-12-21 01:39:18 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-12-21 01:39:18 +0900
commit8034dde023a64b98c6b3edb80a44e4cc23f8979f (patch)
tree38ad756d57390a272bceb7068c19ad1e25587689 /activemodel/lib
parent3da358ea83b86368021d6f289627d0682d24d30b (diff)
downloadrails-8034dde023a64b98c6b3edb80a44e4cc23f8979f.tar.gz
rails-8034dde023a64b98c6b3edb80a44e4cc23f8979f.tar.bz2
rails-8034dde023a64b98c6b3edb80a44e4cc23f8979f.zip
Module#{define_method,alias_method,undef_method,remove_method} become public since Ruby 2.5
https://bugs.ruby-lang.org/issues/14133
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index d8352343e9..5c4670f393 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -507,8 +507,8 @@ module ActiveModel
temp_method_name = "__temp__#{safe_name}#{'=' if writer}"
attr_name_expr = "::ActiveModel::AttributeMethods::AttrNames::#{const_name}"
yield temp_method_name, attr_name_expr
- mod.send(:alias_method, method_name, temp_method_name)
- mod.send(:undef_method, temp_method_name)
+ mod.alias_method method_name, temp_method_name
+ mod.undef_method temp_method_name
end
end
end