I would like to have an end_date attribute within my Goals table.
Currently my schema for Goals is as follows:
create_table "goals", force: true do |t|
t.text "goal"
t.string "theme"
t.boolean "achieved"
t.string "end_date"
t.text "image_url"
t.boolean "public"
t.integer "group_id"
t.datetime "created_at"
t.datetime "updated_at"
end
I currently have this to be a string type. What do you recommend using for the attribute type for a future date that the user will input when creating their goal? I know that there is a "date" type that can be used for my database, which I believe would look like:
t.date "end_date" ?
I do not want it to just save the creation date, I want to save a date which will be chosen by the user. In the research I've done, it seems that t.date will not do that.
The date type can do that. The automatic creation date thing will only happen if the column is named "created_at". Any other name, you should be able to set its value to anything you want.
@htella @harimohanraj89 @DrRobotmck
I would like to have an end_date attribute within my Goals table.
Currently my schema for Goals is as follows: create_table "goals", force: true do |t| t.text "goal" t.string "theme" t.boolean "achieved" t.string "end_date" t.text "image_url" t.boolean "public" t.integer "group_id" t.datetime "created_at" t.datetime "updated_at" end
I currently have this to be a string type. What do you recommend using for the attribute type for a future date that the user will input when creating their goal? I know that there is a "date" type that can be used for my database, which I believe would look like:
t.date "end_date" ?
I do not want it to just save the creation date, I want to save a date which will be chosen by the user. In the research I've done, it seems that t.date will not do that.