I’m storing an array of timestamps in a field in my database as an
array. When the items get saved, however, some minus signs are appended
to the text:
sample output:
1151971200
1152576000
1153180800
1153785600
1154390400
Is this normal behavior? When I retrive the value out of the database
and .to_a, the three minus signs (—) are counted as the first member
of the array. This is not what I was wanting (obviously). How do you
compensate for that without needing to go there and actually stip it
out?
I’m storing an array of timestamps in a field in my database as an
array. When the items get saved, however, some minus signs are appended
to the text:
sample output:
1151971200
1152576000
1153180800
1153785600
1154390400
Is this normal behavior? When I retrive the value out of the database
and .to_a, the three minus signs (—) are counted as the first member
of the array. This is not what I was wanting (obviously). How do you
compensate for that without needing to go there and actually stip it
out?
Thanks so much!
-LW
That’s YAML notation for an array. If you are using “serialize :foo”
they should automatically be converted back into an array for you.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.