Chris Mear wrote:
> On 17 August 2010 03:35, madisonkel <madisonkel...@gmail.com> wrote:
>> My question is what type do you give the variable :preferences for the
>> migration? In:
>>
>> ruby script/generate migration _add_hash_column preferences:???
>>
>> What is ??? -- text, string, something else?
> 
> From the ActiveRecord docs:
> 
> "Active Record can serialize any object in text columns using YAML"
> 
> so the column type is just :text.

Right.  Or :string...any field that can store text will work.

But I'd worry more about why you're storing an array in the DB.  There 
are some legitimate use cases for it, but usually it's a sign that you 
need to do some more normalization of your DB schema.

> 
> Chris

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to