From d32965399ccfa2052a4d52b70db1bae0ca16830b Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 13 Jun 2009 01:01:42 +0200 Subject: uses Object#metaclass and Object#class_eval in a few spots [#2797 state:committed] Signed-off-by: Jeremy Kemper --- activesupport/lib/active_support/core_ext/proc.rb | 2 +- activesupport/lib/active_support/new_callbacks.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/proc.rb b/activesupport/lib/active_support/core_ext/proc.rb index 5c29cc32a2..572fc5f92c 100644 --- a/activesupport/lib/active_support/core_ext/proc.rb +++ b/activesupport/lib/active_support/core_ext/proc.rb @@ -1,7 +1,7 @@ class Proc #:nodoc: def bind(object) block, time = self, Time.now - (class << object; self end).class_eval do + object.class_eval do method_name = "__bind_#{time.to_i}_#{time.usec}" define_method(method_name, &block) # define_method("__bind_1230458026_720454", &block) method = instance_method(method_name) # method = instance_method("__bind_1230458026_720454") diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb index bc340fccec..fa22f85d69 100644 --- a/activesupport/lib/active_support/new_callbacks.rb +++ b/activesupport/lib/active_support/new_callbacks.rb @@ -307,7 +307,7 @@ module ActiveSupport def _normalize_legacy_filter(kind, filter) if !filter.respond_to?(kind) && filter.respond_to?(:filter) - filter.metaclass.class_eval( + filter.class_eval( "def #{kind}(context, &block) filter(context, &block) end", __FILE__, __LINE__ - 1) elsif filter.respond_to?(:before) && filter.respond_to?(:after) && kind == :around -- cgit v1.2.3