Renaming the created_at, updated_at columns of ActiveRecord/Rails

前端 未结 10 667
囚心锁ツ
囚心锁ツ 2020-11-28 07:02

I want to rename the timestamp columns defined in timestamp.rb . Can the methods of timestamp.rb be overwritten? And what has to be done in the application that the module w

10条回答
  •  心在旅途
    2020-11-28 07:53

    Or you could just make your own columns (DateTime) and just manually set the created_at column when you create and set the updated_at column when you update. That might be easier than the hack above. That's what I'm gonna do. Better yet, update rails to allow us to change these names.

提交回复
热议问题