提交 79ef26c8 编写于 作者: A Aaron Patterson

do not pass nil values to arel

上级 31eb7656
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册