Poll Plugin: Don't allow voting on closed topics.

This commit is contained in:
Vikhyat Korrapati
2014-03-16 19:18:40 +05:30
parent ae3f135c33
commit 9ef104bbce
4 changed files with 17 additions and 1 deletions

View File

@ -124,6 +124,8 @@ module ::PollPlugin
end
def set_vote!(user, option)
return if @post.topic.closed?
# Get the user's current vote.
vote = get_vote(user)
vote = nil unless details.keys.include? vote