Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0462307a
Commit
0462307a
authored
Oct 06, 2021
by
Maxime Orefice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecation warning for ActiveModel::Errors#keys
parent
86c34885
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/controllers/concerns/notes_actions.rb
app/controllers/concerns/notes_actions.rb
+1
-1
lib/api/notes.rb
lib/api/notes.rb
+1
-1
spec/models/pages_domain_spec.rb
spec/models/pages_domain_spec.rb
+3
-3
No files found.
app/controllers/concerns/notes_actions.rb
View file @
0462307a
...
...
@@ -62,7 +62,7 @@ module NotesActions
json
.
merge!
(
note_json
(
@note
))
end
if
@note
.
errors
.
present?
&&
@note
.
errors
.
key
s
!=
[
:commands_only
]
if
@note
.
errors
.
present?
&&
@note
.
errors
.
attribute_name
s
!=
[
:commands_only
]
render
json:
json
,
status: :unprocessable_entity
else
render
json:
json
...
...
lib/api/notes.rb
View file @
0462307a
...
...
@@ -88,7 +88,7 @@ module API
note
=
create_note
(
noteable
,
opts
)
if
note
.
errors
.
key
s
==
[
:commands_only
]
if
note
.
errors
.
attribute_name
s
==
[
:commands_only
]
status
202
present
note
,
with:
Entities
::
NoteCommands
elsif
note
.
valid?
...
...
spec/models/pages_domain_spec.rb
View file @
0462307a
...
...
@@ -94,7 +94,7 @@ RSpec.describe PagesDomain do
with_them
do
it
"is adds the expected errors"
do
expect
(
pages_domain
.
errors
.
key
s
).
to
eq
errors_on
expect
(
pages_domain
.
errors
.
attribute_name
s
).
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
.
key
s
).
to
contain_exactly
(
:key
,
:certificate
)
expect
(
domain
.
errors
.
attribute_name
s
).
to
contain_exactly
(
:key
,
:certificate
)
end
end
...
...
@@ -165,7 +165,7 @@ RSpec.describe PagesDomain do
domain
.
valid?
expect
(
domain
.
errors
.
key
s
).
to
contain_exactly
(
:key
)
expect
(
domain
.
errors
.
attribute_name
s
).
to
contain_exactly
(
:key
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment