Problems with the use of time in the migration


I created a table like this:

create_table :work_items do |t| :execution_date
   t.string :section
   t.integer :member_id
   t.time :duration
   t.text :description


I need the duration field to enter something like HH:MM. Just the time
without a date.

When I enter it, everything seems fine... But when I return to the
edit view I see the time formatted like 2000-01-01 10:23:00...

When I create a validate method in the model to check on the input, I
allways get 2000-01-01 10:23:00, weird because I only entered 10:23...

This is the validate method in the model:

]def validate
  puts duration # Results in 2000-01-01 10:23:00

Can anyone help me? I hoped time would work like date, with this
column I don't have any problems...


Ruby doesn't have a pure time of day class. Just don't display the non time of day bit. (eg use time_select instead of datetime_select for editing and so on)