class SimpleJsonapi::Errors::ActiveModelError
Attributes
attribute[R]
message[R]
pointer[R]
Public Class Methods
from_errors(errors, pointer_mapping = {})
click to toggle source
# File lib/simple_jsonapi/errors/active_model_error.rb, line 4 def self.from_errors(errors, pointer_mapping = {}) errors.keys.flat_map do |attribute| errors.full_messages_for(attribute).map do |message| new(attribute, message, pointer_mapping[attribute]) end end end
new(attribute, message, pointer)
click to toggle source
# File lib/simple_jsonapi/errors/active_model_error.rb, line 14 def initialize(attribute, message, pointer) @attribute = attribute.to_s @message = message.to_s @pointer = pointer.to_s end