Hi there,

I'm trying to use a mysql TIME column, which is different than ruby's
Time object (mysql TIME is HH:MM:SS). I was going to put together a
DataMapper::Type::SqlTime type, but you still need a ruby primitive,
which of course doesn't exist for just the time (at least not that I'm
aware of).

I'd like to just use DateTime, but I'm writing a playback system, so
the date is not needed for my usage. I'd like to be able to do
something like this: Program.first :start_time.gt => '12:30:00'. When
I try this, it throws the full date in the query and doesn't work:

(rdb:1) eval Program.first :start_time.gt => "22:40"
 ~ (0.000026) SELECT `id`, `name`, `genre`, `deejays`, `day_of_week`,
`start_time`, `end_time`, `is_active` FROM `programs` WHERE
`start_time` > '2010-02-10 22:40:00' ORDER BY `id` LIMIT 1

Not sure how to approach this one (sans a raw query). How hard is it
to create a type extension that doesn't match an available ruby
primitive?

Any advice would be much appreciated. Thanks!

-Kyle

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to