I recall a story from one of my Botany professors where he encountered a woman picking Solanum dulcamara (nightshade) berries. When he asked her what she was doing with them, she responded that her husband had her make a pie from them every year.
As her husband was presumably still alive, and since I regard this particular professor as reliable, what would have removed enough solanine from the berries to avoid ill effects? Does the concentration decrease upon ripening, or would cooking destroy the toxin? Would that also be why we fry green tomatoes?
(As a disclaimer, no-one should eat plants that are known to be poisonous. Even though some people don't react to poison ivy, it is still a bad idea to rub it all over your body.)