Permalink
Browse files

Merge pull request #10207 from epiclabs/use_define_singleton_method

use define_singleton_method instead of class_eval
  • Loading branch information...
2 parents af7fc66 + 9e82ffc commit 48e9ff75c4a84a3edd0dedf4ec5aa5bc84462401 @fxn fxn 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 48e9ff7

Please sign in to comment.