I've got a model, Favorite, that I'm trying to remove from the
database by calling the destroy method on it. What's noteworthy about
this model is that it doesn't have an id column. The unique index on
the Favorites table is a both the user_id and the article_id. A
favorite belongs to a user and an article.
So in my destroy method of my Favorites Controller, I first retrieve
the favorite to delete:
favorite = Favorite.find_by_article_id_and_user_id(params[:id],
Then I call favorite.destroy and I notice this in the log:
"DELETE FROM favorites where id = NULL"
So the delete doesn't actually work. What gives? Do I HAVE to have
an id column in the favorites table? Thanks for any help.