aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 0d72b9b0c5..9aed6af48b 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -24,8 +24,8 @@ module ActiveRecord
if @options[:finder_sql]
records = @association_class.find_by_sql(@finder_sql)
else
- sql = @finder_sql.dup
- sql << " AND #{sanitize_sql(runtime_conditions)}" if runtime_conditions
+ sql = @finder_sql
+ sql += " AND #{sanitize_sql(runtime_conditions)}" if runtime_conditions
orderings ||= @options[:order]
records = @association_class.find_all(sql, orderings, limit, joins)
end
@@ -37,7 +37,7 @@ module ActiveRecord
@association_class.count_by_sql(@finder_sql)
else
sql = @finder_sql
- sql << " AND #{sanitize_sql(runtime_conditions)}" if runtime_conditions
+ sql += " AND #{sanitize_sql(runtime_conditions)}" if runtime_conditions
@association_class.count(sql)
end
end