Aggiornamento vecchi sondaggi

Continuiamo la discussione da Note di rilascio di Discourse 2.4.0.beta8:

Fantastico vedere i grafici a torta! Immagino che non sia possibile modificare retroattivamente un Sondaggio nel formato a torta, ad esempio inserendo furtivamente chartType=pie nel testo inserito? (Non sono riuscito a farlo reagire a tale modifica, nemmeno dopo la ricottura del messaggio). Stavo cercando di aggiornare alcuni vecchi sondaggi che trarrebbero beneficio da quella presentazione. Grazie!

You need to do it on the rails console:

p = Poll.last
p.chart_type = 'pie'
p.save

Just to add to the Solution:

In my case my site usually has the poll in the first post of the Topic, so a quick way of getting to it on the rails console is this:

myPost = Topic.find_by(id: number-from-topic-url).posts.first.id
myPoll = Poll.find_by(post_id: myPost)

or if you really want to go crazy on one line (scroll right!):

myPoll = Poll.find_by(post_id: Topic.find_by(id: number-from-topic-url).posts.first.id)

Then in this case, of course:

myPoll.chart_type = 'pie'
myPoll.save