FIX: Copy old status to new poll. (#6788)

This commit is contained in:
Bianca Nenciu
2018-12-19 12:29:13 +02:00
committed by Régis Hanol
parent f5c4ab0573
commit c928386c3e
2 changed files with 29 additions and 0 deletions

View File

@ -37,6 +37,7 @@ module DiscoursePoll
attributes = new_poll.slice(*POLL_ATTRIBUTES)
attributes["visibility"] = new_poll["public"] == "true" ? "everyone" : "secret"
attributes["close_at"] = Time.zone.parse(new_poll["close"]) rescue nil
attributes["status"] = old_poll["status"]
poll = ::Poll.new(attributes)
if is_different?(old_poll, poll, new_poll_options)