diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-06-13 04:42:36 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-06-13 04:42:36 +0000 |
commit | 76e4c1a5584c814a761acee6dc36af589e5fe5be (patch) | |
tree | 435b5fbca4ee12eba629fa4f858863bda72a1098 /activerecord/lib | |
parent | fa7f4a066466f8587ddd11b96dcbbe5008ab63a9 (diff) | |
download | rails-76e4c1a5584c814a761acee6dc36af589e5fe5be.tar.gz rails-76e4c1a5584c814a761acee6dc36af589e5fe5be.tar.bz2 rails-76e4c1a5584c814a761acee6dc36af589e5fe5be.zip |
r1294@iwill: jeremy | 2005-06-13 02:17:42 -0700
Ticket #1281
r1295@iwill: jeremy | 2005-06-13 02:50:50 -0700
Apply patch, tweak, and test.
r1296@iwill: jeremy | 2005-06-13 02:51:04 -0700
Changelog entry.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_association.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb index 31b8ac6b9e..847709df8c 100644 --- a/activerecord/lib/active_record/associations/has_many_association.rb +++ b/activerecord/lib/active_record/associations/has_many_association.rb @@ -66,7 +66,9 @@ module ActiveRecord load_target.select { |record| ids.include?(record.id) } end else - options[:conditions] = @finder_sql + (options[:conditions] ? " AND #{options[:conditions]}" : "") + if options[:conditions] = sanitize_sql(options[:conditions]) + options[:conditions] = "#{@finder_sql} AND #{options[:conditions]}" + end if options[:order] && @options[:order] options[:order] = "#{options[:order]}, #{@options[:order]}" |