Sha256: 7fd5ed804541fd4f45bff26b4690ce10c212b1f102d3c637aaf14c3d23650f72

Contents?: true

Size: 306 Bytes

Versions: 12

Compression:

Stored size: 306 Bytes

Contents

module Metaractor
  module FailFromContext
    def fail_from_context(context:)
      return if context.equal?(self)

      invalidate! if context.invalid?
      add_errors(errors: context.errors.to_h)
      @failure = true
    end
  end
end

Interactor::Context.send(:include, Metaractor::FailFromContext)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
metaractor-3.3.4 lib/metaractor/fail_from_context.rb
metaractor-3.3.3 lib/metaractor/fail_from_context.rb
metaractor-3.3.2 lib/metaractor/fail_from_context.rb
metaractor-3.3.0 lib/metaractor/fail_from_context.rb
metaractor-3.2.0 lib/metaractor/fail_from_context.rb
metaractor-3.1.1 lib/metaractor/fail_from_context.rb
metaractor-3.1.0 lib/metaractor/fail_from_context.rb
metaractor-3.0.1 lib/metaractor/fail_from_context.rb
metaractor-3.0.0 lib/metaractor/fail_from_context.rb
metaractor-2.1.1 lib/metaractor/fail_from_context.rb
metaractor-2.1.0 lib/metaractor/fail_from_context.rb
metaractor-2.0.0 lib/metaractor/fail_from_context.rb