Directly delete the "organization is invalid" error
We were getting a warning since upgrading to Rails 6.1: DEPRECATION WARNING: Calling `delete` to an ActiveModel::Errors messages hash is deprecated. Please call `ActiveModel::Errors#delete` instead. So we're deleting the error instead of deleting the message.
This commit is contained in:
@@ -10,7 +10,7 @@ class AccountController < ApplicationController
|
||||
if @account.update(account_params)
|
||||
redirect_to account_path, notice: t("flash.actions.save_changes.notice")
|
||||
else
|
||||
@account.errors.messages.delete(:organization)
|
||||
@account.errors.delete(:organization)
|
||||
render :show
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ class Organizations::RegistrationsController < Devise::RegistrationsController
|
||||
if resource.valid?
|
||||
super do |user|
|
||||
# Removes unuseful "organization is invalid" error message
|
||||
user.errors.messages.delete(:organization)
|
||||
user.errors.delete(:organization)
|
||||
end
|
||||
else
|
||||
render :new
|
||||
|
||||
Reference in New Issue
Block a user