Commit 0462307a authored by Maxime Orefice's avatar Maxime Orefice

Remove deprecation warning for ActiveModel::Errors#keys

parent 86c34885
......@@ -62,7 +62,7 @@ module NotesActions
json.merge!(note_json(@note))
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
else
render json: json
......
......@@ -88,7 +88,7 @@ module API
note = create_note(noteable, opts)
if note.errors.keys == [:commands_only]
if note.errors.attribute_names == [:commands_only]
status 202
present note, with: Entities::NoteCommands
elsif note.valid?
......
......@@ -94,7 +94,7 @@ RSpec.describe PagesDomain do
with_them 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
......@@ -155,7 +155,7 @@ RSpec.describe PagesDomain do
it "adds error to certificate" do
domain.valid?
expect(domain.errors.keys).to contain_exactly(:key, :certificate)
expect(domain.errors.attribute_names).to contain_exactly(:key, :certificate)
end
end
......@@ -165,7 +165,7 @@ RSpec.describe PagesDomain do
domain.valid?
expect(domain.errors.keys).to contain_exactly(:key)
expect(domain.errors.attribute_names).to contain_exactly(:key)
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