Cómo restablecer la fecha de actualización de múltiples temas

How to rest multiple topics bump date

I don’t know what the use case is, but it seems to me, as far as with using the web UI, it would be easy enough to reset the bump date of individual topics when they were bumped. I’m not seeing how “bulk bump date reset” would ever be needed let alone a common enough need for it to need to have a UI.

Anyway, if you’ve somehow managed to get in a situation where you want to work in bulk, it should be possible to do using the CLI

Thanks for the reply.

I use a bot to fetch RSS blog/Podcast to Discourse, when the feed changed, the topics will be updated automatically and bump up. I have to reset one by one so I think it’s should be better if I can bulk reset.

What do you means CLI? Bulk reset via the database? Thanks.

Justo ahora estaba buscando esta función.

Es necesaria porque estaba ordenando y reorganizando cosas en mi foro, y un montón de publicaciones antiguas se volvieron a subir al principio. Ahora tengo que entrar en cada una y restablecer la fecha de subida.

https://github.com/discourse/discourse/blob/master/app/models/topic.rb

Si, repito, si lo he leído correctamente, la tabla Topics tiene un campo bumped_at de tipo datetime, que no puede ser nulo; su valor inicial no nulo es el valor no nulo de created_at. Por lo que sé, la fecha y hora es la que devuelve Ruby now.

Creo que si determinas lo mejor posible

  • qué había inmediatamente antes
  • qué hiciste exactamente
  • qué quieres lograr

tendrás buenas posibilidades de armar una consulta. ¿Cuántos es una “carga”? Si es algo puntual, quizás sea mejor hacerlo a mano.

(Lamentablemente, no hay un campo “prior_to_bump_date” :sadpanda: )

¡Yo también!

¿Cómo se restablece manualmente la fecha de publicación desde la consola de Rails? ¿Revertir bumped_at a updated_at para los temas en cuestión?