From 72de8946515725b8827939d90698e2a082a5eae1 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Wed, 13 Feb 2013 03:40:24 +0100 Subject: Use define_method when method name contains weird characters. --- activerecord/lib/active_record/relation/delegation.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index 00a506c3a7..1b6239eb38 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -37,11 +37,9 @@ module ActiveRecord end RUBY else - module_eval <<-RUBY, __FILE__, __LINE__ + 1 - def #{method}(*args, &block) - scoping { @klass.send(#{method.inspect}, *args, &block) } - end - RUBY + define_method method do |*args, &block| + scoping { @klass.send(method, *args, &block) } + end end end end -- cgit v1.2.3