Skip to content

Commit

Permalink
do not pass nil values to arel
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Sep 22, 2010
1 parent 31eb765 commit 79ef26c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def delete_records(records)
else else
relation = Arel::Table.new(@reflection.options[:join_table]) relation = Arel::Table.new(@reflection.options[:join_table])
relation.where(relation[@reflection.primary_key_name].eq(@owner.id). 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 ).delete
end end
end end
Expand Down

0 comments on commit 79ef26c

Please sign in to comment.