about summary refs log tree commit diff
path: root/app/models/poll.rb
AgeCommit message (Collapse)Author
2023-02-20Autofix Rubocop remaining Layout rules (#23679)Nick Schonning
2022-11-26Clear voter count when poll is reset (#21700)afontenot
When a poll is edited, we reset the poll and remove all previous votes. However, prior to this commit, the voter count on the poll was not reset. This leads to incorrect percentages being shown in poll results. Fixes #21696
2022-05-26Fix regression in `tootctl search deploy` caused by unloaded attribute (#18514)Eugen Rochko
2022-02-10Fix poll votes not being properly reset on poll change (#17498)Claire
* Fix poll votes not being properly reset on poll change * Fix and add tests * Fix poll update handling when the number of options changes
2022-01-19Add support for editing for published statuses (#16697)Eugen Rochko
* Add support for editing for published statuses * Fix references to stripped-out code * Various fixes and improvements * Further fixes and improvements * Fix updates being potentially sent to unauthorized recipients * Various fixes and improvements * Fix wrong words in test * Fix notifying accounts that were tagged but were not in the audience * Fix mistake
2021-01-07Fix rubocop config and warnings (#15503)abcang
* disable NewCops * update TargetRubyVersion * Fix Lint/MissingSuper for ActiveModelSerializers::Model * Fix Lint/MissingSuper for feed * Fix Lint/FloatComparison * Do not use instance variables
2020-12-20Fix AccountDeletionWorker crashing and clogging sidekiq queues (#15380)ThibG
* Fix account deletion workers being queued multiple times for a single account * Fix poll votes being unnecessarily instantiated on poll deletion * Fix favourites being unnecessarily instantiated on status deletion * Remove inaccurate comments * Delete polls instead of destroying them Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2019-12-01Only normalize local polls (#12515)ThibG
Before this patch, if remote poll options have leading or trailing spaces, the information stored locally won't match them, causing federated voting to fail.
2019-09-29Add voters count support (#11917)ThibG
* Add voters count to polls * Add ActivityPub serialization and parsing of voters count * Add support for voters count in WebUI * Move incrementation of voters count out of redis lock * Reword “voters” to “people”
2019-09-22Show user what options they have voted (#11195)ThibG
* Add own_votes field to poll results in REST API Fixes #10679 * Display user votes in WebUI * Update styling * Add vote checkmark to public pages
2019-03-20Add support for custom emojis in poll options (#10322)ThibG
* Backend changes for custom emoji support in poll options * Serialize poll emojis in REST API * Render custom emojis in poll options * Render custom emoji in poll options on public pages
2019-03-13Add UI for enabling/disabling poll notifications (#10255)ThibG
* Add UI for enabling/disabling poll notifications * Add poll notifications to the (advanced) quick filter bar * Update poll notification message “Your poll has ended” → “A poll you have voted in has ended” * Clear up associated notifications when a poll is deleted
2019-03-08Do not allow adding votes to expired polls (#10214)ThibG
* Do not allow adding votes to expired polls * Only validate expires_at on create
2019-03-07Immediately display poll results to poll author (#10187)Eugen Rochko
* Immediately display poll results to poll author * Refactor Poll#loaded_options and add Poll#voted? to improve DRYness
2019-03-06Add optimistic lock to avoid race conditions when handling votes (#10196)ThibG
* Add optimistic lock to avoid race conditions when handling votes * Force-reload polls when getting `ActiveRecord::StaleObjectError`
2019-03-05Fix poll options not being stripped of surrounding whitespace on save (#10168)Eugen Rochko
2019-03-03Add polls (#10111)Eugen Rochko
* Add polls Fix #1629 * Add tests * Fixes * Change API for creating polls * Use name instead of content for votes * Remove poll validation for remote polls * Add polls to public pages * When updating the poll, update options just in case they were changed * Fix public pages showing both poll and other media