Permalink
Browse files

use define_singleton_method instead of class_eval

  • Loading branch information...
1 parent af7fc66 commit 9e82ffcadac1860d5b835035e4dc4490ef6ed791 Francesco Rodriguez committed Apr 13, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 activesupport/lib/active_support/per_thread_registry.rb
@@ -36,10 +36,8 @@ module PerThreadRegistry
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)

0 comments on commit 9e82ffc

Please sign in to comment.