aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorKrzysztof Jurewicz <krzysztof.jurewicz@gmail.com>2013-02-13 03:40:24 +0100
committerKrzysztof Jurewicz <krzysztof.jurewicz@gmail.com>2013-03-18 21:01:04 +0100
commit72de8946515725b8827939d90698e2a082a5eae1 (patch)
treedb867944b0aee3059da5815a90c711bc1248415e /activerecord/lib/active_record
parentc4a7c31581c8386198317a2385f9c7d462c18497 (diff)
downloadrails-72de8946515725b8827939d90698e2a082a5eae1.tar.gz
rails-72de8946515725b8827939d90698e2a082a5eae1.tar.bz2
rails-72de8946515725b8827939d90698e2a082a5eae1.zip
Use define_method when method name contains weird characters.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/delegation.rb8
1 files changed, 3 insertions, 5 deletions
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