mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
RFC: Json Api Errors (WIP)
- ActiveModelSerializers::JsonPointer - ActiveModel::Serializer::Adapter::JsonApi::Error - ActiveModel::Serializer::Adapter::JsonApi::Error.attributes - Fix rubocop config
This commit is contained in:
11
test/fixtures/poro.rb
vendored
11
test/fixtures/poro.rb
vendored
@@ -27,6 +27,17 @@ class Model < ActiveModelSerializers::Model
|
||||
end
|
||||
end
|
||||
|
||||
# see
|
||||
# https://github.com/rails/rails/blob/4-2-stable/activemodel/lib/active_model/errors.rb
|
||||
# The below allows you to do:
|
||||
#
|
||||
# model = ModelWithErrors.new
|
||||
# model.validate! # => ["cannot be nil"]
|
||||
# model.errors.full_messages # => ["name cannot be nil"]
|
||||
class ModelWithErrors < ::ActiveModelSerializers::Model
|
||||
attr_accessor :name
|
||||
end
|
||||
|
||||
class Profile < Model
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user