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:
Benjamin Fleischer
2015-07-14 00:29:15 -05:00
parent df815c48ba
commit 0ba944dabf
16 changed files with 329 additions and 2 deletions

11
test/fixtures/poro.rb vendored
View File

@@ -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