// BeforeInsert is a model hook executed before insertion of blog.
BeforeInsert is a model hook executed before insertion of blog.
// BeforeInsert is a model hook executed before insertion of blog .
func (b *Blog) BeforeInsert(ctx context.Context, _ database.DB) error {
	ts, ok := ctx.Value("timestamp").(time.Time)
	if !ok {
		log.Errorf("no timestamp found in the context")
	}
	log.Debugf("Blog: %d is being inserted at: %s", ts.String())
	return nil
}
func ( b * Blog ) BeforeInsert ( ctx context . Context , _ database . DB ) error { ts , ok := ctx . Value ( " " ) . ( time . Time ) if ! ok { log . Errorf ( " " ) } log . Debugf ( " " , ts . String ( ) ) return nil }
BeforeInsert is a model hook executed before insertion of blog.
BeforeInsert is a model hook executed before insertion of blog .