New Discussion

Notifications

You’re not receiving notifications from this thread.

How do I add a default time of 6:45pm

1
Rails

Hi

Following on from the my previous post

I want to add a new time column with the default of 6.46pm

I have tried this

class AddUsualStartTimeToAreas < ActiveRecord::Migration
def change
add_column :areas, :usual_start_time, :time, default: "18:45"
end
end

but it gives me a date?? which i don't want??

t.time    "usual_start_time",                         default: '2000-01-01 18:45:00'

its ok

in my area model i converted this to this usual_start_time.to_formatted_s(:time)
and is working

Join the discussion
Create an account Log in