Skip to content

Commit 9dee9d8

Browse files
committed
Fixed failed tests.
1 parent 5b0c51c commit 9dee9d8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/jsonapi/active_model_error_serializer.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
module JSONAPI
44
# [ActiveModel::Errors] serializer
55
class ActiveModelErrorSerializer < ErrorSerializer
6-
set_id :object_id
7-
set_type :error
8-
96
attribute :status do
107
'422'
118
end

lib/jsonapi/error_serializer.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module JSONAPI
55
class ErrorSerializer
66
include JSONAPI::Serializer
77

8-
set_id :object_id
98
set_type :error
109

1110
# Object/Hash attribute helpers.
@@ -15,6 +14,12 @@ class ErrorSerializer
1514
end
1615
end
1716

17+
# Overwrite the ID extraction method, to skip validations
18+
#
19+
# @return [NilClass]
20+
def self.id_from_record(_record, _params)
21+
end
22+
1823
# Remap the root key to `errors`
1924
#
2025
# @return [Hash]

0 commit comments

Comments
 (0)