Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not pass nil values to arel

  • Loading branch information...
commit 79ef26c8c99985f9b438df8822635d8f0ea36fa2 1 parent 31eb765
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
@@ -79,7 +79,7 @@ def delete_records(records)
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
Please sign in to comment.
Something went wrong with that request. Please try again.