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:
@@ -30,7 +30,7 @@ class UserNameChangeRequest < ApplicationRecord
|
||||
|
||||
def not_limited
|
||||
if UserNameChangeRequest.unscoped.where(user: user).where("created_at >= ?", 1.week.ago).exists?
|
||||
errors[:base] << "You can only submit one name change request per week"
|
||||
errors.add(:base, "You can only submit one name change request per week")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user