diff options
author | Xavier Noria <fxn@hashref.com> | 2013-04-13 10:32:01 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-04-13 10:32:01 -0700 |
commit | 48e9ff75c4a84a3edd0dedf4ec5aa5bc84462401 (patch) | |
tree | adb9937e718b731c72b05ab341ea4ed613a25ef8 /activesupport | |
parent | af7fc660e5a952eb76b9e9b211d63fa317c4bf07 (diff) | |
parent | 9e82ffcadac1860d5b835035e4dc4490ef6ed791 (diff) | |
download | rails-48e9ff75c4a84a3edd0dedf4ec5aa5bc84462401.tar.gz rails-48e9ff75c4a84a3edd0dedf4ec5aa5bc84462401.tar.bz2 rails-48e9ff75c4a84a3edd0dedf4ec5aa5bc84462401.zip |
Merge pull request #10207 from epiclabs/use_define_singleton_method
use define_singleton_method instead of class_eval
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/per_thread_registry.rb | 6 |
1 files changed, 2 insertions, 4 deletions
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) |