fix the build

This commit is contained in:
Régis Hanol 2018-05-03 10:32:01 +02:00
parent 8d0c073d39
commit 9ff2d540ba
5 changed files with 5 additions and 9 deletions

View File

@ -197,6 +197,7 @@ const rule = {
state.push('poll_close', 'div', -1);
state.push('poll_close', 'div', -1);
state.push('poll_close', 'div', -1);
}
};

View File

@ -7,9 +7,7 @@ module DiscoursePoll
def validate_polls
polls = {}
extracted_polls = DiscoursePoll::Poll::extract(@post.raw, @post.topic_id, @post.user_id)
extracted_polls.each do |poll|
DiscoursePoll::Poll::extract(@post.raw, @post.topic_id, @post.user_id).each do |poll|
# polls should have a unique name
return false unless unique_poll_name?(polls, poll)

View File

@ -6,7 +6,7 @@ module DiscoursePoll
.pluck(:post_id)
post_ids.each do |post_id|
DistributedMutex.synchronize("#{DiscoursePoll::MUTEX_PREFIX}-#{post_id}") do
DistributedMutex.synchronize("discourse_poll-#{post_id}") do
post = Post.find_by(id: post_id)
update_votes(post, source_user, target_user) if post
end

View File

@ -171,7 +171,7 @@ after_initialize do
cooked = PrettyText.cook(raw, topic_id: topic_id, user_id: user_id)
Nokogiri::HTML(cooked).css("div.poll").map do |p|
poll = { "options" => [], "voters" => 0 }
poll = { "options" => [], "voters" => 0, "name" => DiscoursePoll::DEFAULT_POLL_NAME }
# attributes
p.attributes.values.each do |attribute|

View File

@ -106,13 +106,10 @@ describe PrettyText do
<div class="poll-info">
<p>
<span class="info-number">0</span>
<span class="info-text">voters</span>
<span class="info-label">voters</span>
</p>
</div>
</div>
<div class="poll-buttons">
<a title="Display the poll results">Show results</a>
</div>
</div>
MD