aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-20 14:35:00 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-20 14:35:00 +0000
commit4ddbe0ac44efaa166dfb5cb95cf217254ca5855e (patch)
treec4d645d992ba9b9d02401caa58546bea2a36dad2 /activerecord
parent1a5bf720b2827a74bcc89f4ffd2ab0da537c6015 (diff)
downloadrails-4ddbe0ac44efaa166dfb5cb95cf217254ca5855e.tar.gz
rails-4ddbe0ac44efaa166dfb5cb95cf217254ca5855e.tar.bz2
rails-4ddbe0ac44efaa166dfb5cb95cf217254ca5855e.zip
Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG5
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 37212abee3..965054b4b6 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,3 +1,8 @@
+*SVN*
+
+* Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
+
+
*1.5.1* (January 18th, 2005)
* Fixed that the belongs_to and has_one proxy would fail a test like 'if project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 92f6f4c262..f3ab6bcdab 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -20,7 +20,7 @@ module ActiveRecord
if @options[:finder_sql]
records = @association_class.find_by_sql(@finder_sql)
else
- sql = @finder_sql
+ sql = @finder_sql.dup
sql << " AND #{sanitize_sql(runtime_conditions)}" if runtime_conditions
orderings ||= @options[:order]
records = @association_class.find_all(sql, orderings, limit, joins)