We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61d887a commit 043791fCopy full SHA for 043791f
1 file changed
lib/jsonapi/resource.rb
@@ -117,6 +117,19 @@ def save
117
end
118
119
120
+ # Override this on a resource to return a different result code. Any
121
+ # value other than :completed will result in operations returning
122
+ # `:accepted`
123
+ #
124
+ # For example to return `:accepted` if your model does not immediately
125
+ # save resources to the database you could override `_save` as follows:
126
127
+ # ```
128
+ # def _save
129
+ # super
130
+ # return :accepted
131
+ # end
132
133
def _save
134
unless @model.valid?
135
raise JSONAPI::Exceptions::ValidationErrors.new(@model.errors.messages)
0 commit comments