Update topic after editing time limit has passed

I would like to let users bump topic with a help of a button “Bump topic” as long as topic is not closed or archived.

I’m almost there but stumbeled upon TopicController’s update method … more specifically upon guardian.ensure_can_edit!(topic) inside the update method. It prevents user from changing their older posts.

Is my only option to go with direct SQL update of a topic or is there “standard” way to achieve this?

1 me gusta

Wait, I am unclear, can you explain exactly what you are trying to achieve here?

1 me gusta

Because in general I would like indeed topic to be closed for editing… in this case it’s a category where people sell their old/used stuff. In the beginning people should be able to edit their posts as we have certain rules they should follow (photos, necessary information etc). After some time it’s safe to say the post is “finished” apart the price which can go down. People are allowed to “bump” their topic with the help of a button which appears 72 hours after last “bump” (whether bu button or some other person’s post in the topic).

So there it is … what I want to achieve. I have a button. I can bump editable posts but what if something is “in the market” for 2 years? 4 years? :slight_smile:

1 me gusta

Still not following,

  • Do you want to give end users the ability to “bump” topics and have them show up first in latest, but only once in 48 hours, without forcing them to post on the topic?

  • Are you trying to lift editing limit temporarily from a topic?

Keep in mind once there is more than one post in a topic, editing OP does not bump topic.

1 me gusta

Yes, this is exactly what I’m trying to do.

1 me gusta

Then I would recommend you would make a plugin with a special controller that simply updates bumped_at on the topic to Time.zone.now and handles all permissions etc in said controller.

3 Me gusta

¿Alguien más ha pedido alguna vez un botón de \u003ckbd\u003eBump topic\u003c/kbd\u003e? Tengo un cliente que utiliza Discourse como plataforma interna de preguntas y respuestas para su empresa y quiere permitir a sus colegas “impulsar” temas que no están recibiendo suficiente atención, sin añadir una respuesta de una palabra “bump”.

Obviamente, esto podría ser molesto para la mayoría de las comunidades, pero ¿quizás podría añadirse como un plugin opcional o un componente de tema? :thinking:

Ya creé este plugin hace mucho tiempo :slight_smile:

No sé si todavía funciona, pero puedes probarlo

(Ya no lo uso… por eso no lo sé)

3 Me gusta

¡Gracias! ¿Cómo te funcionó la adición del botón en tu comunidad? Creo que para la mayoría de los sitios sería molesto, pero puedo ver el beneficio para un sitio de preguntas y respuestas donde la gente está esperando una respuesta pero no quiere saturar el tema con publicaciones de “yo también” sin sentido.

Esto podría implementarse ahora como un componente temático.

Esto se creó en realidad para acompañar mi plugin de compra/venta/intercambio… plugin que añadía dichos botones a los temas y para que los usuarios no “inundaran” la categoría de comercio con publicaciones de “subir” (que por cierto no estaban permitidas… teníamos reglas y moderadores). Así que cuando querías vender algo, creabas tu tema y cada 3 días podías “subir” con la ayuda de un botón.

1 me gusta