[Rails] type system
Scott Barron
scott at elitists.net
Thu Dec 9 13:47:52 GMT 2004
On Thu, Dec 09, 2004 at 11:03:15AM +0200, Jarkko Laine wrote:
>
> I'm also very interested in the 'interval' datatype. I'm writing an
> application that needs to store time intervals and the lack of support
> for them would solely be enough for me to choose PG instead of MySQL.
> However, as long as there's no equivalent type on the ruby side, it
> doesn't take me that far. So what would it take to get:
> - a working mapping for 'interval' (or whatever) datatype
> - a form helper that would understand that type and produce the input
> widgets as specified?
>
> I'm willing to commit this myself, I just need a few pointers on where
> to start from.
>
> //jarkko
I'm currently porting an application to rails where I utilize intervals
(as the run time of a movie). Right now I've just got a Ruby class that
turns the string (eg "01:00:00") given from the database into the number
of seconds (since that's all I really need). I also opened up
Object::Time and added the ability to + one of my Intervals (just for
convenience). What Ruby type are you thinking you'd want pg's interval
mapped to?
-Scott
More information about the Rails
mailing list