Change pie to bar in active poll

Hi all,

is it possible to change from pie to bar in an active poll? I created a poll and then edited the post and changed from pie to bar, as I do not see the participants in the pie version of the poll, although they should be public. Now I see “bar” in the post code, but it is still a pie poll. Maybe because it is active and cannot be changed anymore? Questions over questions. :wink:

Hello :wave:

I found this topic.

I’ve tested it now and works fine. :slightly_smiling_face:

3 Likes

Thank you @Don, but I have a little understanding problem. :wink: I only would like to edit this one single poll. What would I type into the rail console?

What Don showed you should be correct.

myPoll = Poll.find_by(post_id: Topic.find_by(id: 7068).posts.first.id)
myPoll.chart_type = 'pie'
myPoll.save

You want to find the Topic data based on the topic ID (7068).
You retrieve the poll data based on the first post ID.
You change the chart type and save.

3 Likes

@Arkshine @Don thank you for making this clear to me and sorry, sometimes I’m kinda dumb when it comes to programming languages I do not really understand. :wink:

And most important, it worked, I have the bars and also see who voted for what option! :slight_smile: Thank you!

3 Likes