I have an array, example below, that I am serializing into the database and the result is below the example. I’ve tried using ”, “” and nil, the former two insert themselves somehow and nil inserts !!nil which when read back is giving me some weird object.
In my model.
serialize :display_instructions
In my controller.
display_instructions = [["object", '', 5]]
The result is below…
---
- - places
- ''
- 5
If I edit this and remove the ” it works as expected, the problem seems to be on and off. For a while it worked as expected and I got nothing where the quotes are but now it’s doing it again.
Thanks in advance for the help!
EDIT: As the title suggest, the problem is that it’s inserting quotes where I want nothing at all, even using ” ” inserts the double surrounding quotes.
Jay
Ok thanks to Jordan for tipping me in the correct direction. The problem was in the backend it was only checking nil? and not empty? – problem fixed.
Just to reiterate what he said, ” and “” are how blank strings are represented in YAML.