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); state.push('poll_close', 'div', -1);
state.push('poll_close', 'div', -1);
} }
}; };

View File

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

View File

@ -6,7 +6,7 @@ module DiscoursePoll
.pluck(:post_id) .pluck(:post_id)
post_ids.each do |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) post = Post.find_by(id: post_id)
update_votes(post, source_user, target_user) if post update_votes(post, source_user, target_user) if post
end end

View File

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

View File

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