From 0a259b94f02218ff19c77fc980399c260aff491e Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Sat, 5 Jun 2021 11:37:15 +0200 Subject: [PATCH] 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) --- 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 02224aea194..816b06ff648 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -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