I have a table defined with the following migration
create_table :posts, :force => true do |t|
t.string :owner_name
t.string :name
t.binary :value
t.timestamps
end
I'm trying to save some basic data types into the value column, but some data types are generating a "undefined method 'encoding'" message.
Integers, Floats and Symbols values fail. All that seems to work are string values. Does anyone know why this is happening? I thought the point of a blob column was it could be more general.
My goal is to have a column that can take multiple data types. Plan B would be to store the datatype name in it's own column and then type cast a string representation back when the data is retrieved, but I'd like to understand why the blog is failing.