From 72e7271687e52312030dbbf295c468d85b6bc00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 2 Dec 2015 17:25:01 +0100 Subject: [PATCH] FIX: '.intersect?' isn't available in older version of ruby --- plugins/poll/plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index 5754ef8ccba..18306e86cc7 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -84,7 +84,7 @@ after_initialize do post.custom_fields[VOTES_CUSTOM_FIELD].each do |user_id, user_votes| next unless votes = user_votes[poll_name] votes.each { |option| all_options[option] += 1 } - poll["voters"] += 1 if available_options.intersect?(votes.to_set) + poll["voters"] += 1 if (available_options & votes.to_set).size > 0 end poll["options"].each { |o| o["votes"] = all_options[o["id"]] }