On Tue, 2008-06-03 at 07:46 -0400, Ram Ravichandran
wrote:> Hi,
>
> I was wondering if anyone knows how ActiveRecord deals with Postgresql
> arrays? Specifically I am trying to figure out how to:
> a) Setup migration that creates the following table:
>
> CREATE TABLE sal_emp (
> name text,
> pay_by_quarter integer[]
> );
>
> b) insert records into this table through activerecord like
> SalEmp.create({:name => "Tom", :pay_by_quarter => [1,2,3]})
> Is this even possible?
>
----
You could serialize the array and save the serialized array as a string
in the database and then break the array apart...all as part of the
model.
Craig
--~--~---------~--~----~------------~-------~--~----~
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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---