diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 19:22:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 19:22:37 -0700 |
commit | 79ef26c8c99985f9b438df8822635d8f0ea36fa2 (patch) | |
tree | c19436b0ad1a412987d9930b0c13c4ead7a46d6c | |
parent | 31eb76564068aa8750cec050906a3739fa1f56a6 (diff) | |
download | rails-79ef26c8c99985f9b438df8822635d8f0ea36fa2.tar.gz rails-79ef26c8c99985f9b438df8822635d8f0ea36fa2.tar.bz2 rails-79ef26c8c99985f9b438df8822635d8f0ea36fa2.zip |
do not pass nil values to arel
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index c0ec65bd40..605bc9c66f 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -79,7 +79,7 @@ module ActiveRecord else relation = Arel::Table.new(@reflection.options[:join_table]) relation.where(relation[@reflection.primary_key_name].eq(@owner.id). - and(relation[@reflection.association_foreign_key].in(records.map { |x| x.id })) + and(relation[@reflection.association_foreign_key].in(records.map { |x| x.id }.compact)) ).delete end end |