Commit e684ebae authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch 'mo-remove-deprecation-warning-activemodel-errors-keys-is-deprecated-and-will-be-removed-in' into 'master'

Remove deprecation warning for ActiveModel::Errors#keys

See merge request gitlab-org/gitlab!71854
parents f53ad0ec 0462307a
...@@ -62,7 +62,7 @@ module NotesActions ...@@ -62,7 +62,7 @@ module NotesActions
json.merge!(note_json(@note)) json.merge!(note_json(@note))
end end
if @note.errors.present? && @note.errors.keys != [:commands_only] if @note.errors.present? && @note.errors.attribute_names != [:commands_only]
render json: json, status: :unprocessable_entity render json: json, status: :unprocessable_entity
else else
render json: json render json: json
......
...@@ -88,7 +88,7 @@ module API ...@@ -88,7 +88,7 @@ module API
note = create_note(noteable, opts) note = create_note(noteable, opts)
if note.errors.keys == [:commands_only] if note.errors.attribute_names == [:commands_only]
status 202 status 202
present note, with: Entities::NoteCommands present note, with: Entities::NoteCommands
elsif note.valid? elsif note.valid?
......
...@@ -94,7 +94,7 @@ RSpec.describe PagesDomain do ...@@ -94,7 +94,7 @@ RSpec.describe PagesDomain do
with_them do with_them do
it "is adds the expected errors" do it "is adds the expected errors" do
expect(pages_domain.errors.keys).to eq errors_on expect(pages_domain.errors.attribute_names).to eq errors_on
end end
end end
end end
...@@ -155,7 +155,7 @@ RSpec.describe PagesDomain do ...@@ -155,7 +155,7 @@ RSpec.describe PagesDomain do
it "adds error to certificate" do it "adds error to certificate" do
domain.valid? domain.valid?
expect(domain.errors.keys).to contain_exactly(:key, :certificate) expect(domain.errors.attribute_names).to contain_exactly(:key, :certificate)
end end
end end
...@@ -165,7 +165,7 @@ RSpec.describe PagesDomain do ...@@ -165,7 +165,7 @@ RSpec.describe PagesDomain do
domain.valid? domain.valid?
expect(domain.errors.keys).to contain_exactly(:key) expect(domain.errors.attribute_names).to contain_exactly(:key)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment