Sha256: d037292e146322982d7679087d5f30bc69fd1f7b4187e8a448d0896ebbb02d1f

Contents?: true

Size: 579 Bytes

Versions: 119

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

require "active_model/error"
require "forwardable"

module ActiveModel
  class NestedError < Error
    def initialize(base, inner_error, override_options = {})
      @base = base
      @inner_error = inner_error
      @attribute = override_options.fetch(:attribute) { inner_error.attribute }
      @type = override_options.fetch(:type) { inner_error.type }
      @raw_type = inner_error.raw_type
      @options = inner_error.options
    end

    attr_reader :inner_error

    extend Forwardable
    def_delegators :@inner_error, :message
  end
end

Version data entries

119 entries across 114 versions & 12 rubygems

Version Path
activemodel-7.0.3 lib/active_model/nested_error.rb
activemodel-7.0.2.4 lib/active_model/nested_error.rb
activemodel-6.1.5.1 lib/active_model/nested_error.rb
activemodel-6.1.5 lib/active_model/nested_error.rb
activemodel-7.0.2.3 lib/active_model/nested_error.rb
activemodel-6.1.4.7 lib/active_model/nested_error.rb
activemodel-7.0.2.2 lib/active_model/nested_error.rb
activemodel-6.1.4.6 lib/active_model/nested_error.rb
activemodel-6.1.4.5 lib/active_model/nested_error.rb
activemodel-7.0.2.1 lib/active_model/nested_error.rb
activemodel-7.0.2 lib/active_model/nested_error.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/activemodel-6.1.4.4/lib/active_model/nested_error.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/activemodel-6.1.4.4/lib/active_model/nested_error.rb
activemodel-7.0.1 lib/active_model/nested_error.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/activemodel-6.1.4.4/lib/active_model/nested_error.rb
activemodel-7.0.0 lib/active_model/nested_error.rb
activemodel-6.1.4.4 lib/active_model/nested_error.rb
activemodel-7.0.0.rc3 lib/active_model/nested_error.rb
activemodel-6.1.4.3 lib/active_model/nested_error.rb
activemodel-6.1.4.2 lib/active_model/nested_error.rb