Sha256: b05bcf862b8f0610f75acf99b8f128e297aff889848986a0e605cefc15947f85

Contents?: true

Size: 267 Bytes

Versions: 10

Compression:

Stored size: 267 Bytes

Contents

module ActiveModel
  class Serializer
    class ErrorSerializer < ActiveModel::Serializer
      # @return [Hash<field_name,Array<error_message>>]
      def as_json
        object.errors.messages
      end

      def success?
        false
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
active_model_serializers-0.10.8 lib/active_model/serializer/error_serializer.rb
active_model_serializers-0.10.7 lib/active_model/serializer/error_serializer.rb
active_model_serializers-0.10.6 lib/active_model/serializer/error_serializer.rb
active_model_serializers-0.10.5 lib/active_model/serializer/error_serializer.rb
active_model_serializers-0.10.4 lib/active_model/serializer/error_serializer.rb
agi_active_model_serializers-0.10.9 lib/active_model/serializer/error_serializer.rb
agi_active_model_serializers-0.10.8 lib/active_model/serializer/error_serializer.rb
agi_active_model_serializers-0.10.7 lib/active_model/serializer/error_serializer.rb
active_model_serializers-0.10.3 lib/active_model/serializer/error_serializer.rb
active_model_serializers-0.10.2 lib/active_model/serializer/error_serializer.rb