diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-19 17:43:30 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-19 17:44:07 -0700 |
commit | 08636527b5f5ba1c96937e86fd0c6e816462a1eb (patch) | |
tree | 2728c5d3a919012b5b8137e35c9eca4a0166ba48 /activerecord/lib | |
parent | 78b6f6410522fa634b639645e7f53bca31f5bccc (diff) | |
download | rails-08636527b5f5ba1c96937e86fd0c6e816462a1eb.tar.gz rails-08636527b5f5ba1c96937e86fd0c6e816462a1eb.tar.bz2 rails-08636527b5f5ba1c96937e86fd0c6e816462a1eb.zip |
avoid cloning if we do not need to clone
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index e8bd4dc485..d0f11526ac 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -120,6 +120,8 @@ module ActiveRecord def extending(*modules) modules << Module.new(&Proc.new) if block_given? + return self if modules.empty? + relation = clone relation.send(:apply_modules, modules.flatten) relation |