Fix ActiveModel::Errors#[]= deprecation warning
DEPRECATION WARNING: ActiveModel::Errors#[]= is deprecated and will be removed in Rails 5.1. Use model.errors.add(:attachment, "content type image/png does not match any of accepted content types pdf") instead. (called from validate_attachment_content_type at /home/travis/build/consul/consul/app/models/document.rb:92)
This commit is contained in:
@@ -51,7 +51,7 @@ class DirectUpload
|
||||
@relation.valid?
|
||||
|
||||
if @relation.errors.key? :attachment
|
||||
errors[:attachment] = @relation.errors[:attachment]
|
||||
errors.add(:attachment, @relation.errors.full_messages_for(:attachment))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user