We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a081330 commit 51d2c2fCopy full SHA for 51d2c2f
lib/jsonapi_errorable/validatable.rb
@@ -1,8 +1,13 @@
1
module JsonapiErrorable
2
module Validatable
3
- def render_errors_for(record)
4
- validation = Serializers::Validation.new \
5
- record, deserialized_params.relationships
+ # @param relationships: nil [Hash] list of relationships to be serialized as errors
+ # @param record [ ActiveModel ] Object that implements ActiveModel
+ def render_errors_for(record, relationships: nil)
6
+ validation = Serializers::Validation.new(
7
+ record,
8
+ relationships || deserialized_params.relationships
9
+ )
10
+
11
12
render \
13
json: { errors: validation.errors },
0 commit comments