From 8034dde023a64b98c6b3edb80a44e4cc23f8979f Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 21 Dec 2018 01:39:18 +0900 Subject: Module#{define_method,alias_method,undef_method,remove_method} become public since Ruby 2.5 https://bugs.ruby-lang.org/issues/14133 --- activerecord/lib/active_record/scoping/named.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/scoping') diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index d5cc5db97e..5278eb29a9 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -179,13 +179,13 @@ module ActiveRecord extension = Module.new(&block) if block if body.respond_to?(:to_proc) - singleton_class.send(:define_method, name) do |*args| + singleton_class.define_method(name) do |*args| scope = all._exec_scope(*args, &body) scope = scope.extending(extension) if extension scope end else - singleton_class.send(:define_method, name) do |*args| + singleton_class.define_method(name) do |*args| scope = body.call(*args) || all scope = scope.extending(extension) if extension scope -- cgit v1.2.3