Rails控制台仅显示日期时间列的日期

我的Reminders模型中有两列( datemail_date ),其列类型为datetime ,您可以在schema.rb看到:

 create_table "reminders", force: :cascade do |t| t.string "name" t.datetime "date" t.boolean "reminder", default: false t.string "repeating" t.boolean "approved" t.boolean "gift", default: false t.boolean "gift_help", default: false t.string "occasion_type", default: "Other" t.integer "user_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "slug" t.datetime "mail_date" end 

但是,在我的console ,它们仅显示为日期:

 [33] pry(main)> Reminder.where(name: "Mentor Call") Reminder Load (0.4ms) SELECT "reminders".* FROM "reminders" WHERE "reminders"."name" = ? [["name", "Mentor Call"]] => [#] 

我知道正在保存datetime数据,因为它显示在我的视图页面上,这里…

 October 27, 2016 07:00 Mentor Call ... 2016-10-27 07:00:00 UTC 

…是从这个erb生成的:

          ...     None, you're on your own.    

我正在尝试创建一个发送mail_datemailer ,但由于此datetimedate问题而遇到问题(我认为)。 任何人都可以理顺我吗?

我怀疑date列的名称与Rails’或Ruby的保留字相符。 将date列的名称更改为其他内容,例如remind_at ,这应该可以解决问题:

 create_table "reminders", force: :cascade do |t| t.string "name" t.datetime "remind_at" t.boolean "reminder", default: false # ... end