From 68a949bae7408dafdfdd28b6c1de25d5348e64c7 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 28 Aug 2010 21:35:20 -0300 Subject: PERF: Avoid two method calls --- activerecord/lib/active_record/relation/spawn_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index 05b26cd0c4..e7e5f26ce0 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -8,7 +8,7 @@ module ActiveRecord ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) - [:joins, :where]).each do |method| value = r.send(:"#{method}_values") - if value.present? + unless value.empty? if method == :includes merged_relation = merged_relation.includes(value) else -- cgit v1.2.3