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:
@@ -51,7 +51,7 @@ class PostDisapproval < ApplicationRecord
|
||||
|
||||
def validate_disapproval
|
||||
if post.is_active?
|
||||
errors[:post] << "is already active and cannot be disapproved"
|
||||
errors.add(:post, "is already active and cannot be disapproved")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user