LoginSignup
0
0

More than 5 years have passed since last update.

mini_recordを使ったら日付が入ってなかった

Posted at

Padrinoでmini_recordを使って、ActiveRecord用のサンプルをポチポチしてたら、日付がないよと怒られた。

ActiveRecordはデフォでcreated_at, updated_atが入るけどmini_recordでは明示しないとだめぽい

created_at, updated_atをそれぞれ書いてもいいけど、timestampsを書けば両方定義してくれるので楽

sample_model.rb
class SampleModel < ActiveRecord::Base
  timestamps
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0