I have built a couple of these, one that is very heavily interlocked and sealed inside a box, so it is safer.
This is a nice experiment to go with flame tests as a slightly more exciting example. Though playing with mains is obviously dangerous, so the first one was in a box with interlocks to make it impossible to touch anything live without turning it off.
This is great, but fogs up quite fast, so a second version was buit to be much more visible in a lecture environment. You have to press both switches at the same time which can't be done with one hand, making it much harder to accidently electrocute youself.
The body of the gherkinator is designed so that any liquids run away from the electrics into the tray and the control is designed so that you can only operate it with both hands - so you can't be touching the gherkin when it is electrofied. The forks are also removable so the tray can be cleaned.