From 9e82ffcadac1860d5b835035e4dc4490ef6ed791 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Sat, 13 Apr 2013 12:14:12 -0500 Subject: use define_singleton_method instead of class_eval --- activesupport/lib/active_support/per_thread_registry.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/per_thread_registry.rb b/activesupport/lib/active_support/per_thread_registry.rb index e9499600a4..aa682fb36c 100644 --- a/activesupport/lib/active_support/per_thread_registry.rb +++ b/activesupport/lib/active_support/per_thread_registry.rb @@ -36,10 +36,8 @@ module ActiveSupport def method_missing(name, *args, &block) # :nodoc: # Caches the method definition as a singleton method of the receiver. - singleton_class.class_eval do - define_method(name) do |*a, &b| - per_thread_registry_instance.public_send(name, *a, &b) - end + define_singleton_method(name) do |*a, &b| + per_thread_registry_instance.public_send(name, *a, &b) end send(name, *args, &block) -- cgit v1.2.3