aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/enum.rb2
-rw-r--r--activerecord/lib/active_record/relation/delegation.rb2
-rw-r--r--activerecord/lib/active_record/scoping/named.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb
index d7cb7691e0..e6dba66a08 100644
--- a/activerecord/lib/active_record/enum.rb
+++ b/activerecord/lib/active_record/enum.rb
@@ -158,7 +158,7 @@ module ActiveRecord
# def self.statuses() statuses end
detect_enum_conflict!(name, name.pluralize, true)
- singleton_class.send(:define_method, name.pluralize) { enum_values }
+ singleton_class.define_method(name.pluralize) { enum_values }
defined_enums[name] = enum_values
detect_enum_conflict!(name, name)
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb
index 383dc1bf4b..6f67dd3784 100644
--- a/activerecord/lib/active_record/relation/delegation.rb
+++ b/activerecord/lib/active_record/relation/delegation.rb
@@ -54,7 +54,7 @@ module ActiveRecord
end
RUBY
else
- generated_relation_methods.send(:define_method, method) do |*args, &block|
+ generated_relation_methods.define_method(method) do |*args, &block|
scoping { klass.public_send(method, *args, &block) }
end
end
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