Make sure empty string values for code and path are saved as nil value

since the cart promotion handler expects code and path to be nil.
Other solution could be to change the where clauses to search for empty strings,
but that would mean updating all specs and factories to set an empty string
and I like the nil value better.

[Fixes #4059]