aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-06-13 01:01:42 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2009-06-12 16:14:06 -0700
commitd32965399ccfa2052a4d52b70db1bae0ca16830b (patch)
tree7f41b1846efd2d11d7ebff15a115cba02ad75f11 /activesupport/lib
parent54a5446641e4386285231385700b95a223931bff (diff)
downloadrails-d32965399ccfa2052a4d52b70db1bae0ca16830b.tar.gz
rails-d32965399ccfa2052a4d52b70db1bae0ca16830b.tar.bz2
rails-d32965399ccfa2052a4d52b70db1bae0ca16830b.zip
uses Object#metaclass and Object#class_eval in a few spots
[#2797 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/proc.rb2
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb2
2 files changed, 2 insertions, 2 deletions
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