module Jennifer::Model::Timestamp

Direct including types

Defined in:

jennifer/model/timestamp.cr

Macro Summary

Macro Detail

macro with_timestamps(created_at = true, updated_at = true) #

Adds callbacks for created_at and updated_at fields.

class MyModel < Jennifer::Model::Base
  with_timestamps

  mapping(
    id: {type: Int32, primary: true},
    created_at: {type: Time, null: true},
    updated_at: {type: Time, null: true}
  )
end

[View source]