Permalink
Browse files

do not pass nil values to arel

  • Loading branch information...
1 parent 31eb765 commit 79ef26c8c99985f9b438df8822635d8f0ea36fa2 @tenderlove tenderlove committed Sep 22, 2010
@@ -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

0 comments on commit 79ef26c

Please sign in to comment.