Rails 4 with Postgres 9.2. 'pg' gem version 0.16.0.
Model attribute looks like this in schema.rb:
t.string "codes", array: true
I'm trying to store the following array of strings in this field:
["", "a string"]
In the database table, data for this field is stored as {"","a string"} which is what I expect.
However, in Rails, retrieving this attribute via model.codes strips out the first element in the array and returns just:
["a string"]
a) What happened to the (intentionally-placed) empty string I had in the array?
b) If I replace the empty string, with a single space character, the retrieved attribute looks fine ([" ", "a string"]), but I'm hoping not to have to resort to that.