do not pass nil values to arel

This commit is contained in:
Aaron Patterson 2010-09-21 19:22:37 -07:00
parent 31eb765640
commit 79ef26c8c9

@ -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