Logistic & Rental Requests belong to each other via a TypeLogistic table. I accidentally created a bad TypeLogistic, so now there are two:
TypeLogistic.where(rental_request_id:200).where(logistic_id:130)
=> #<ActiveRecord::Relation [#<TypeLogistic rental_request_id: 200, logistic_id: 130, type_of_logistics: nil>, #<TypeLogistic rental_request_id: 200, logistic_id: 130, type_of_logistics: "delivery">]>
How do I destroy the first one? Tried running below, didn't work
TypeLogistic.where(rental_request_id:200).where(logistic_id:130).first.destroy
PG::Error: ERROR: zero-length delimited identifier at or near """"
LINE 1: DELETE FROM "type_logistics" WHERE "type_logistics"."" = $1
^