do not pass nil values to arel
This commit is contained in:
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
|
||||
|
Loading…
Reference in New Issue
Block a user