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:
parent
9f650b45a0
commit
0a259b94f0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue