Sha256: ecb56eff4559a306a0aa66a02e1fa77b74131f650ecb2c8e4fce3388f6a31904

Contents?: true

Size: 427 Bytes

Versions: 1

Compression:

Stored size: 427 Bytes

Contents

# encoding: UTF-8
# frozen_string_literal: true

module ExclusiveErrorMessage
  module Extension
    def full_message(attribute, message)
      if message.respond_to?(:start_with?) && message.start_with?('_') # Support non-string error messages like hashes.
        message[1..-1]
      else
        super
      end
    end
  end
end

require 'active_model/errors'

ActiveModel::Errors.prepend ExclusiveErrorMessage::Extension

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exclusive-error-message-1.0.1 lib/exclusive-error-message.rb