models: fix deprecated errors[:base] << "message" calls.
Replace the idiom `errors[:base] << "message"` with `errors.add(:base, "message")`. The former is deprecated in Rails 6.1.
This commit is contained in:
@@ -45,7 +45,7 @@ class Ban < ApplicationRecord
|
||||
end
|
||||
|
||||
def validate_user_is_bannable
|
||||
self.errors[:user] << "is already banned" if user.is_banned?
|
||||
errors.add(:user, "is already banned") if user.is_banned?
|
||||
end
|
||||
|
||||
def update_user_on_create
|
||||
|
||||
Reference in New Issue
Block a user