DEV: Fix an ActiveModel::Errors deprecation

The warning was:

DEPRECATION WARNING: Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated. Please call `ActiveModel::Errors#add` instead. (called from block (3 levels) in activate! at discourse/plugins/poll/plugin.rb:519)
This commit is contained in:
Jarek Radosz 2021-06-05 11:37:15 +02:00 committed by Alan Guo Xiang Tan
parent 9f650b45a0
commit 0a259b94f0

View File

@ -516,7 +516,7 @@ after_initialize do
result = NewPostResult.new(:poll, false)
post.errors.full_messages.each do |message|
result.errors[:base] << message
result.add_error(message)
end
result