diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-27 16:38:54 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-27 16:38:54 -0300 |
commit | 7b0402fabb2ed9801108b060434f83e6f25a4748 (patch) | |
tree | fd072e553f7f006b7e41811f9538f99acd6ddd8d /activerecord/lib | |
parent | e7438501d69f266aca4ba5d6f511b9fe5264862f (diff) | |
parent | 72de8946515725b8827939d90698e2a082a5eae1 (diff) | |
download | rails-7b0402fabb2ed9801108b060434f83e6f25a4748.tar.gz rails-7b0402fabb2ed9801108b060434f83e6f25a4748.tar.bz2 rails-7b0402fabb2ed9801108b060434f83e6f25a4748.zip |
Merge pull request #9274 from KrzysiekJ/spaces_in_scope_names
Use define_method when method name contains weird characters.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 8 |
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 |